1- name : Deploy backstage
1+ name : Deploy Backstage
22
33on :
4- push :
5- branches :
6- - main
7- pull_request :
8- branches :
9- - main
4+ workflow_run :
5+ workflows : ["CI Workflow"]
6+ types :
7+ - completed
108
119jobs :
1210 create-and-push-image :
1311 permissions :
1412 id-token : write
15- contents : read
16- name : " Create and push the Docker image to GAR"
13+ contents : read # Remove if not required
14+
15+ name : " Create and Push Docker Image to GAR"
1716 runs-on : ubuntu-latest
1817 defaults :
1918 run :
2019 shell : bash
2120
2221 steps :
23- - name : Checkout
22+ - name : Checkout Repository
2423 uses : actions/checkout@v4
2524
26- - id : ' setup-qemu '
27- name : Set up QEMU
25+ - name : Set up QEMU
26+ id : setup-qemu
2827 uses : docker/setup-qemu-action@v3
2928
30- - id : ' docker-buildx-setup '
31- name : Set up Docker Buildx
29+ - name : Set up Docker Buildx
30+ id : docker-buildx-setup
3231 uses : docker/setup-buildx-action@v3
3332
34- - name : ' Authenticate to Google Cloud'
35- id : ' auth'
36- uses : ' google-github-actions/auth@v2'
33+ - name : Authenticate to Google Cloud
34+ id : auth
35+ uses : google-github-actions/auth@v2
3736 with :
3837 create_credentials_file : true
3938 token_format : " access_token"
4039 workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
4140 service_account : ${{ secrets.GCP_DEPLOY_SA }}
4241
43- - name : " Login to GAR"
44- id : ' login-gar'
42+ - name : Login to GAR
43+ id : login-gar
4544 uses : docker/login-action@v3
4645 with :
4746 registry : ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}
4847 username : oauth2accesstoken
4948 password : ${{ steps.auth.outputs.access_token }}
5049
51- - id : ' build- and-push '
52- name : ' Build and Push docker Image '
50+ - name : Build and Push Docker Image
51+ id : build- and-push
5352 uses : docker/build-push-action@v5
5453 with :
5554 push : true
@@ -60,44 +59,45 @@ jobs:
6059 build-args : |
6160 APP_ENV=docker
6261
63-
6462 deploy-image :
6563 permissions :
6664 id-token : write
67- contents : read
65+ contents : read # Remove if not required
6866
69- name : " Deploy image on cloud run "
67+ name : " Deploy Image on Cloud Run "
7068 runs-on : ubuntu-latest
69+ needs : create-and-push-image
7170 defaults :
7271 run :
7372 shell : bash
74- needs : create-and-push-image
7573
7674 steps :
77- - name : Checkout
75+ - name : Checkout Repository
7876 uses : actions/checkout@v4
7977
80- - id : ' auth '
81- name : ' Authenticate to Google Cloud '
82- uses : ' google-github-actions/auth@v2'
78+ - name : Authenticate to Google Cloud
79+ id : auth
80+ uses : google-github-actions/auth@v2
8381 with :
8482 create_credentials_file : true
8583 workload_identity_provider : ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
8684 service_account : ${{ secrets.GCP_DEPLOY_SA }}
8785
8886 - name : Deploy to Cloud Run
89- id : ' deploy'
90- uses : ' google-github-actions/deploy-cloudrun@v2'
87+ id : deploy
88+ uses : google-github-actions/deploy-cloudrun@v2
9189 with :
9290 service : ${{ secrets.GCP_CLOUD_RUN_SERVICE }}
9391 image : ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_GAR_REPO }}/backstage-image:${{ github.sha }}
9492 region : ${{ secrets.GCP_REGION }}
95- flags : ' --platform managed --allow-unauthenticated --port=7007'
96- secrets : |-
93+ flags : |
94+ --platform managed
95+ --allow-unauthenticated
96+ --port=7007
97+ secrets : |
9798 GITHUB_TOKEN=github_token:latest
9899 GITLAB_TOKEN=gitlab_token:latest
99100 GOOGLE_CLIENT_ID=google_client_id:latest
100101 GOOGLE_CLIENT_SECRET=google_client_secret:latest
101102 PROD_GITHUB_CLIENT_SECRET=github_client_secret:latest
102103 PROD_GITHUB_CLIENT_ID=github_client_id:latest
103-
0 commit comments