|
19 | 19 | tags:
|
20 | 20 | - 'v*'
|
21 | 21 | env:
|
22 |
| - SOURCE_DOCKER_IMAGE: 'us-docker.pkg.dev/github-metrics-ci/ci-images/github-metrics-aggregator-server:${{ github.sha }}' |
23 |
| - DEST_DOCKER_REPO: 'us-docker.pkg.dev/abcxyz-artifacts/docker-images/github-metrics-aggregator-server:${{ github.ref_name }}' |
24 | 22 | WIF_PROVIDER: 'projects/138221849759/locations/global/workloadIdentityPools/github-pool-ac8f/providers/github-provider'
|
25 | 23 | WIF_SERVICE_ACCOUNT: 'github-metrics-ac8f-ci-sa@github-metrics-ci.iam.gserviceaccount.com'
|
| 24 | + SOURCE_DOCKER_IMAGE: 'us-docker.pkg.dev/github-metrics-ci/ci-images/github-metrics-aggregator-server:${{ github.sha }}' |
| 25 | + TARGET_DOCKER_IMAGE: 'us-docker.pkg.dev/abcxyz-artifacts/docker-images/github-metrics-aggregator-server:${{ github.ref_name }}' |
| 26 | + PROD_PROJECT_ID: 'github-metrics-prod' |
| 27 | + PROD_REGION: 'us-central1' |
| 28 | + PROD_SERVICE_NAME: 'github-metrics-webhook-51e3' |
26 | 29 |
|
27 | 30 | # Don't cancel in progress since we don't want to have half-baked releases.
|
28 | 31 | concurrency: '${{ github.workflow }}-${{ github.head_ref || github.ref }}-release'
|
|
58 | 61 | docker pull ${{ env.SOURCE_DOCKER_IMAGE }}-arm64
|
59 | 62 | docker tag ${{ env.SOURCE_DOCKER_IMAGE }}-arm64 ${{ env.TARGET_DOCKER_IMAGE }}-arm64
|
60 | 63 | docker push ${{ env.TARGET_DOCKER_IMAGE }}-arm64
|
| 64 | +
|
| 65 | + production: |
| 66 | + runs-on: 'ubuntu-latest' |
| 67 | + environment: 'production' |
| 68 | + needs: |
| 69 | + - 'image-release' |
| 70 | + permissions: |
| 71 | + contents: 'read' |
| 72 | + id-token: 'write' |
| 73 | + steps: |
| 74 | + - name: 'Checkout' |
| 75 | + uses: 'actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c' # ratchet:actions/checkout@v3 |
| 76 | + - id: 'auth' |
| 77 | + name: 'Authenticate to Google Cloud' |
| 78 | + uses: 'google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d' # ratchet:google-github-actions/auth@v1 |
| 79 | + with: |
| 80 | + workload_identity_provider: '${{ env.WIF_PROVIDER }}' |
| 81 | + service_account: '${{ env.WIF_SERVICE_ACCOUNT }}' |
| 82 | + - name: 'Setup gcloud' |
| 83 | + uses: 'google-github-actions/setup-gcloud@d51b5346f85640ec2aa2fa057354d2b82c2fcbce' # ratchet:google-github-actions/setup-gcloud@v1 |
| 84 | + - name: 'Deploy to Cloud Run' |
| 85 | + run: |- |
| 86 | + gcloud run services update ${{ env.PROD_SERVICE_NAME }} \ |
| 87 | + --project="${{ env.PROD_PROJECT_ID }}" \ |
| 88 | + --region="${{ env.PROD_REGION }}" \ |
| 89 | + --image="${{ env.TARGET_DOCKER_IMAGE }}-amd64" |
0 commit comments