-
Notifications
You must be signed in to change notification settings - Fork 2
29 lines (26 loc) · 895 Bytes
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Deploy to Cloud Run
on:
push:
branches:
- main
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
RUN_REGION: us-east1
SA_KEY_JSON: ${{ secrets.GCP_SA_KEY_JSON }}
jobs:
deploy:
name: Deploy to Cloud Run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup gcloud CLI
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: "290.0.1"
service_account_key: ${{ secrets.GCP_SA_KEY_JSON }}
project_id: ${{ secrets.GCP_PROJECT_ID }}
# Build and push image to Google Container Registry
- name: Build
run: gcloud builds submit --tag gcr.io/$PROJECT_ID/$PROJECT_ID:$GITHUB_SHA
- name: Deploy
run: gcloud run deploy $PROJECT_ID --image gcr.io/$PROJECT_ID/$PROJECT_ID:$GITHUB_SHA --platform managed --region $RUN_REGION --allow-unauthenticated