chore: short-sha workflow to simple GITHUB_SHA refs (#18332) #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Runtime - deploy grafana manifests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - infra/runtime/grafana-manifests/** | |
| - .github/workflows/deploy-runtime-grafana-manifests.yaml | |
| workflow_dispatch: | |
| inputs: | |
| environments: | |
| description: "Runtime environments to tag. Comma-separated (e.g. tt_ring1,tt_ring2)." | |
| required: false | |
| default: "tt_ring1" | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| construct-rings-array: | |
| uses: ./.github/workflows/template-runtime-construct-environments.yaml | |
| with: | |
| inputs: ${{ toJSON(github.event.inputs) }} | |
| override-default-runtime-environments: tt_ring1,tt_ring2,prod_ring1,prod_ring2 | |
| push-grafana-manifests-artifact: | |
| name: Push grafana manifests as OCI artifact | |
| runs-on: ubuntu-latest | |
| environment: dev | |
| env: | |
| REGISTRY_NAME: altinncr | |
| outputs: | |
| config-repo: ${{ steps.vars.outputs.config-repo }} | |
| defaults: | |
| run: | |
| working-directory: infra/runtime/grafana-manifests | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set vars | |
| id: vars | |
| run: echo "config-repo=altinncr.azurecr.io/studio-apps/runtime-grafana-manifests-repo:${GITHUB_SHA::10}" >> "$GITHUB_OUTPUT" | |
| - name: az login | |
| uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2 | |
| with: | |
| client-id: ${{ secrets.AZURE_CLIENT_ID_FC }} | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }} | |
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }} | |
| - name: az acr login | |
| run: az acr login --name ${{ env.REGISTRY_NAME }} | |
| - name: flux install | |
| uses: fluxcd/flux2/action@bfa461ed2153ae5e0cca6bce08e0845268fb3088 # v2.8.2 | |
| - name: push artifact | |
| working-directory: infra/runtime/grafana-manifests | |
| run: | | |
| flux push artifact oci://${{ steps.vars.outputs.config-repo }} \ | |
| --provider=azure \ | |
| --reproducible \ | |
| --path="." \ | |
| --source="$(git config --get remote.origin.url)" \ | |
| --revision="$(git branch --show-current)/$(git rev-parse HEAD)" | |
| tag-grafana-manifests: | |
| name: Tag grafana manifests | |
| needs: [push-grafana-manifests-artifact, construct-rings-array] | |
| runs-on: ubuntu-latest | |
| environment: ${{ matrix.environment }} | |
| strategy: | |
| matrix: | |
| include: ${{ fromJson(needs.construct-rings-array.outputs.result) }} | |
| steps: | |
| - name: az login | |
| uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2 | |
| with: | |
| client-id: ${{ secrets.AZURE_CLIENT_ID_FC }} | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID_FC }} | |
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FC }} | |
| - name: az acr login | |
| run: az acr login --name altinncr | |
| - name: flux install | |
| uses: fluxcd/flux2/action@bfa461ed2153ae5e0cca6bce08e0845268fb3088 # v2.8.2 | |
| - name: tag artifact | |
| run: | | |
| flux tag artifact oci://${{ needs.push-grafana-manifests-artifact.outputs.config-repo }} \ | |
| --tag ${{ matrix.ring }} |