-
Notifications
You must be signed in to change notification settings - Fork 22
46 lines (41 loc) · 1.34 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# .github/workflows/deploy.yml
name: Deploy 🚀 Clima to Google Cloud Run (☁🏃)
on:
push:
branches:
- main
jobs:
deploy:
name: Deploying 🚀 Clima
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'bump version')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Export gcloud related env variable
run: export CLOUDSDK_PYTHON="/usr/bin/python3"
# Build and push image to Google Container Registry
- name: Setting up
uses: google-github-actions/setup-gcloud@v0
with:
version: '318.0.0'
service_account_key: ${{ secrets.GCP_SA_KEY_JSON }}
service_account_email: "federico.tartarini@bears-berkeley.sg"
project_id: clima-316917
- name: Building (🏗️)
run: |-
gcloud builds submit \
--tag us-docker.pkg.dev/clima-316917/gcr.io/clima
# Setup gcloud CLI
- name: Deploy (🚀)
uses: google-github-actions/deploy-cloudrun@v1
with:
service: clima
image: us-docker.pkg.dev/clima-316917/gcr.io/clima
region: us-central1
credentials: ${{ secrets.GCP_SA_KEY_JSON }}
project_id: clima-316917