-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcd.yml
More file actions
58 lines (43 loc) · 1.41 KB
/
cd.yml
File metadata and controls
58 lines (43 loc) · 1.41 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
name: cd
on:
push:
branches: [main]
pull_request:
types: [closed]
branches: [main]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Check for sensitive credentials
run: git diff HEAD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.0'
- name: Build notely
run: ./scripts/buildprod.sh
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: 'Use gcloud CLI'
run: 'gcloud info'
- name: Build Docker Image
run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-444620/notely-ar-repo/notely:latest .
- name: Install Goose
run: go install github.com/pressly/goose/v3/cmd/goose@latest
- name: Run the migrations
run: ./scripts/migrateup.sh
- name: Deploy to Cloud Run
run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-444620/notely-ar-repo/notely:latest --region us-central1 --allow-unauthenticated --project notely-444620 --max-instances=4