Update README.md #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy to Cloud Run | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Google Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: gcr.io | |
username: _json_key | |
password: ${{ secrets.MUBAZIR }} | |
- name: Setup gcloud CLI | |
uses: google-github-actions/[email protected] | |
with: | |
project_id: ${{ secrets.PROJECT_ID }} | |
service_account_key: ${{ secrets.MUBAZIR }} | |
export_default_credentials: true | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
no-cache: false | |
tags: ${{ secrets.GAR_LOCATION }}:latest | |
- name: Deploy to Cloud Run | |
run: | | |
gcloud run deploy ${{ secrets.SERVICE }} \ | |
--image ${{ secrets.GAR_LOCATION }}:latest \ | |
--region ${{ secrets.REGION }} \ | |
--platform managed \ | |
--allow-unauthenticated |