-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.28 KB
/
cloud-run-action.yaml
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
name: Continous Deployment (CD)
on:
push:
pull_request:
jobs:
build:
name: Cloud Run Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup GCP Service Account
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: "latest"
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Configure Docker
run: |
gcloud auth configure-docker
- name: Build
run: |
docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/heymart-auth:latest .
- name: Push
run: |
docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/heymart-auth:latest
- name: Deploy
run: |
gcloud run deploy heymart-auth \
--region europe-west1 \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/heymart-auth \
--platform managed \
--allow-unauthenticated \
--project ${{ secrets.GCP_PROJECT_ID }} \
--set-env-vars=PG_HOST=${{ secrets.PG_HOST }} \
--set-env-vars=PG_DB=${{ secrets.PG_USER }} \
--set-env-vars=PG_USER=${{ secrets.PG_PASS }}