-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (32 loc) · 1.26 KB
/
deploy-back-run.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
name: Back End Deployment on Cloud Run
on:
push:
branches: [ "main" ]
jobs:
# To build the project
build-back:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./travian/backend/
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checking out code
uses: actions/checkout@v3
- name: Google Auth
id: auth
uses: 'google-github-actions/[email protected]'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Fix Auth
run: yes | gcloud auth login --cred-file="$GOOGLE_APPLICATION_CREDENTIALS"
- name: Deploy to Cloud Run
run: gcloud run deploy backend --image=gcr.io/ecstatic-motif-393807/backend:1.0.0 --port=8000 --platform managed --allow-unauthenticated --region=europe-west1 \
--add-cloudsql-instances ecstatic-motif-393807:us-central1:travian-db \
--set-env-vars INSTANCE_UNIX_SOCKET="/cloudsql/ecstatic-motif-393807:us-central1:travian-db" \
--set-env-vars INSTANCE_CONNECTION_NAME="ecstatic-motif-393807:us-central1:travian-db" \
--set-env-vars DB_NAME="quickstart_db" \
--set-env-vars DB_USER="pierre" \
--set-env-vars DB_PASS="123456"