File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -122,3 +122,8 @@ jobs:
122122 echo "Service URL: ${{ steps.deploy.outputs.url }}"
123123 echo "Version: v${{ steps.extract_version.outputs.version }}"
124124 echo "Revision: ${{ env.API_NAME }}-v${{ steps.extract_version.outputs.revision_version }}"
125+
126+ sync-metadata :
127+ needs : deploy
128+ uses : ./.github/workflows/load-library-metadata.yml
129+ secrets : inherit
Original file line number Diff line number Diff line change @@ -2,10 +2,19 @@ name: Load Library API Metadata
22
33on :
44 workflow_dispatch :
5+ workflow_call :
6+
7+ env :
8+ PROJECT_ID : benefit-decision-toolkit-play
9+ REGION : us-central1
10+ WORKLOAD_IDENTITY_PROVIDER : projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github
511
612jobs :
713 run-script :
814 runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ id-token : write
918
1019 steps :
1120 - name : Checkout repo
1625 with :
1726 python-version : " 3.11"
1827
19- - name : Create GCP credentials file
28+ # use a specific service account for sync script
29+ - name : Create GCP credentials file (for sync script)
2030 run : |
2131 echo '${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}' > bin/library/gcp-key.json
2232
3040
3141 - name : Cleanup credentials
3242 run : rm bin/library/gcp-key.json
43+
44+ # Use a different service account with permissions to restart builder-api
45+ - name : Authenticate to Google Cloud (for restarting builder-api)
46+ uses : google-github-actions/auth@v2
47+ with :
48+ workload_identity_provider : ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
49+ service_account : cicd-build-deploy-api@${{ env.PROJECT_ID }}.iam.gserviceaccount.com
50+ project_id : ${{ env.PROJECT_ID }}
51+
52+ - name : Set up Cloud SDK
53+ uses : google-github-actions/setup-gcloud@v2
54+
55+ - name : Restart builder-api with updated library metadata
56+ run : |
57+ gcloud run services update builder-api \
58+ --region ${{ env.REGION }} \
59+ --update-env-vars LIBRARY_SYNC_TIMESTAMP=$(date -u +%Y%m%dT%H%M%SZ)
You can’t perform that action at this time.
0 commit comments