Skip to content

Update google-cloudrun-docker.yml #15

Update google-cloudrun-docker.yml

Update google-cloudrun-docker.yml #15

name: Deploy Angular Blog to Cloud Run
on:
push:
branches:
- main # or any other branch you use for production
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build Angular app
run: npm run build --prod
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Install Google Cloud SDK
run: |
echo "Installing Google Cloud SDK"
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-get update && sudo apt-get install -y google-cloud-sdk
gcloud version
- name: Deploy to Cloud Run using Buildpacks
uses: google-github-actions/deploy-cloudrun@v2
with:
service: angular-blog # your Cloud Run service name
region: europe-central2 # match to your region
source: .