Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name: Docker Image CI
- on:
- push:
- tags:
- - release-production-*
- jobs:
- build_and_push_to_gcp:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout the repository
- uses: actions/checkout@v1
- - name: Check commit sha ...
- run: echo ${{ github.sha }}
- - name: Build the Docker image
- uses: actions/docker/cli@master
- with:
- args: "build --file Dockerfile --tag gcr.io/gear2019v2/gear2019v2-frontend:latest ."
- - name: Authenticate into Google Cloud Platform
- uses: actions/gcloud/auth@master
- env:
- GCLOUD_AUTH: ${{ secrets.GCLOUD_AUTH }}
- - name: Configure Docker to use Google Cloud Platform
- uses: actions/gcloud/cli@master
- with:
- args: "auth configure-docker --quiet"
- - name: Push image to Google Cloud Container Registry
- uses: actions/gcloud/cli@master
- with:
- entrypoint: sh
- args: -c "docker push gcr.io/gear2019v2/gear2019v2-frontend:latest"
- deploy_to_cloud_run:
- needs: [ build_and_push_to_gcp ]
- runs-on: ubuntu-latest
- steps:
- - name: Authenticate into Google Cloud Platform
- uses: actions/gcloud/auth@master
- env:
- GCLOUD_AUTH: ${{ secrets.GCLOUD_AUTH }}
- - name: Install beta commands and deploy on Cloud Run
- uses: actions/gcloud/cli@master
- with:
- args: "components install beta --quiet && gcloud components update --quiet && gcloud beta run deploy gear2019v2-frontend --quiet --image gcr.io/gear2019v2/gear2019v2-frontend:latest --project gear2019v2 --region asia-northeast1 --platform managed"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement