-
Notifications
You must be signed in to change notification settings - Fork 1.1k
51 lines (39 loc) · 1.21 KB
/
cd.yml
File metadata and controls
51 lines (39 loc) · 1.21 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
name: cd
on:
push:
branches: [main]
jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Build app
run: npm run build
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Build and Push Docker image
run: gcloud builds submit --tag us-central1-docker.pkg.dev/nootely-for-key/notely-ar-repo/notely:latest .
- name: Run database migrations
run: npm run db:migrate
- name: Deploy to Cloud Run
run: |
gcloud run deploy notely \
--image us-central1-docker.pkg.dev/nootely-for-key/notely-ar-repo/notely:latest \
--region us-central1 \
--allow-unauthenticated \
--project nootely-for-key \
--max-instances=4