-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (27 loc) · 994 Bytes
/
cd.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
name: cd
on:
push:
branches: [main]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Check out code
uses: actions/checkout@v3
- name: Build app
run: make
- 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'
- name: 'Build and push Docker image'
run: 'gcloud builds submit --tag us-central1-docker.pkg.dev/learntocodefyi-prod/learntocodefyi-ar-repo/learntocodefyi:latest .'
- name: 'Deploy to Cloud Run'
run: 'gcloud run deploy learntocodefyi --image us-central1-docker.pkg.dev/learntocodefyi-prod/learntocodefyi-ar-repo/learntocodefyi:latest --region us-central1 --allow-unauthenticated --project learntocodefyi-prod'