Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/deploy-library-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ jobs:
echo "Service URL: ${{ steps.deploy.outputs.url }}"
echo "Version: v${{ steps.extract_version.outputs.version }}"
echo "Revision: ${{ env.API_NAME }}-v${{ steps.extract_version.outputs.revision_version }}"

sync-metadata:
needs: deploy
uses: ./.github/workflows/load-library-metadata.yml
secrets: inherit
26 changes: 26 additions & 0 deletions .github/workflows/load-library-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ name: Load Library API Metadata

on:
workflow_dispatch:
workflow_call:

env:
PROJECT_ID: benefit-decision-toolkit-play
REGION: us-central1
SERVICE: benefit-decision-toolkit-play
WORKLOAD_IDENTITY_PROVIDER: projects/1034049717668/locations/global/workloadIdentityPools/github-actions-google-cloud/providers/github

jobs:
run-script:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout repo
Expand All @@ -30,3 +40,19 @@ jobs:

- name: Cleanup credentials
run: rm bin/library/gcp-key.json

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
service_account: cicd-build-deploy-api@${{ env.PROJECT_ID }}.iam.gserviceaccount.com
project_id: ${{ env.PROJECT_ID }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Restart builder-api with updated library metadata
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep things consistent, we may want to use the same step from line 82 of deploy-builder-api.yml here. That step allows for configuring of API_NAME and REGION.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point, I'll look into it.

run: |
gcloud run deploy builder-api \
--image us-central1-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/builder-api:latest \
--region ${{ env.REGION }}