-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.4 KB
/
firebase-hosting-merge.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
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Deploy to Cloud Run on merge
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "23"
- name: Install dependencies
run: npm install
- name: Run build
run: npm run build:prod
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Login to Google Cloud
uses: google-github-actions/auth@v1
with:
create_credentials_file: true
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Build Docker Image
run: docker build -t ${{ secrets.GCP_PROJECT_ID }}/bookenzy-backend:latest .
- name: Push Docker Image to Container Registry
run: docker push ${{ secrets.GCP_PROJECT_ID }}/bookenzy-backend:latest
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v0
with:
image: ${{ secrets.GCP_PROJECT_ID }}/bookenzy-backend:latest
service: bookenzy-backend
project: ${{ secrets.GCP_PROJECT_ID }}
credentials: ${{ secrets.GCP_SA_KEY }}