123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- name: Build and Deploy to Cloud Run
- on:
- push:
- branches:
- - master
- env:
- PROJECT_ID: sunfmin
- GAR_LOCATION: gcr.io
- SERVICE: goplaid-docs
- REGION: us-central1
- jobs:
- deploy:
-
- permissions:
- contents: 'read'
- id-token: 'write'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Google Auth
- id: auth
- uses: 'google-github-actions/auth@v0'
- with:
- token_format: 'access_token'
- workload_identity_provider: '${{ secrets.WIF_PROVIDER }}'
- service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}'
-
-
-
-
-
-
-
-
- - name: Docker Auth
- id: docker-auth
- uses: 'docker/login-action@v1'
- with:
- username: 'oauth2accesstoken'
- password: '${{ steps.auth.outputs.access_token }}'
- registry: 'gcr.io'
- - name: Build and Push Container
- run: |-
- docker build -t "gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}" -f ./docs/Dockerfile .
- docker push "gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}"
-
- - name: Deploy to Cloud Run
- id: deploy
- uses: google-github-actions/deploy-cloudrun@v0
- with:
- service: ${{ env.SERVICE }}
- region: ${{ env.REGION }}
-
- image: gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}
-
- - name: Show Output
- run: echo ${{ steps.deploy.outputs.url }}
|