Skip to content

Commit

Permalink
ci: cloud run auto deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz authored Oct 2, 2023
1 parent ceca6be commit 467bb7c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,22 @@ jobs:

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

deploy:
needs: build-and-push
runs-on: ubuntu-latest
strategy:
matrix:
locale: ['en', 'tw', 'ja']
env:
RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/release') && 'latest' || 'dev' }}
CLOUDRUN_SERVICE_NAME: ${{ startsWith(github.ref, 'refs/tags/release') && 'site' || 'site-staging' }}
steps:
- uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: ${{ secrets.GC_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GC_SERVICE_ACCOUNT }}
- uses: 'google-github-actions/deploy-cloudrun@v1'
with:
service: ${{ env.CLOUDRUN_SERVICE_NAME }}-${{matrix.locale}}
image: cofacts/rumors-site:${{ env.RELEASE_TAG }}-${{ matrix.locale }}

0 comments on commit 467bb7c

Please sign in to comment.