Skip to content

Commit

Permalink
cloudrun deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan committed Dec 14, 2023
1 parent c5f4fac commit 8dea3e7
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Deploy to Cloud Run"

on:
push:

env:
DOCKER_IMAGE_URL: ${{ var.GCP_GAR_LOCATION }}-docker.pkg.dev/${{ var.GCP_PROJECT_ID }}/${{ var.GCP_REPO }}/${{ var.GCP_APP }}:${{ github.sha }}
SERVICE: ${{ var.GCP_SERVICE }}
PROJECT_ID: ${{ var.GCP_PROJECT_ID }}

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Google auth
id: auth
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: '${{ env.PROJECT_ID }}'

- name: Docker Auth
run: |-
docker build -t ${{ env.DOCKER_IMAGE_URL }} --file Dockerfile .
docker push ${{ env.DOCKER_IMAGE_URL }}
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v1
with:
service: ${{ env.SERVICE }}
image: ${{ env.DOCKER_IMAGE_URL }}

0 comments on commit 8dea3e7

Please sign in to comment.