Skip to content

try again

try again #11

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