-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.17 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
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@v0
with:
credentials: ${{ secrets.GCP_CREDENTIALS }}
- name: Build and Deploy to Cloud Run
run: |
gcloud builds submit --tag gcr.io/${{ secrets.GCP_PROJECT_ID }}/bookenzy
gcloud run deploy your-service-name \
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/bookenzy \
--platform managed \
--region asia-south2 \
--allow-unauthenticated