Files
learn-cicd-starter/.github/workflows/cd.yml
2025-03-16 15:05:54 +02:00

43 lines
1.0 KiB
YAML

name: cd
on:
push:
branches: [main]
jobs:
deploy:
permissions:
contents: 'read'
id-token: 'write'
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.0"
- name: Build
run: scripts/buildprod.sh
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: 'Use gcloud CLI'
run: 'gcloud info'
- name: Push to Google
run: gcloud builds submit --tag us-central1-docker.pkg.dev/notely-453912/notely-ar-repo/notely:latest .
- name: Deploy to Cloud Run
run: gcloud run deploy notely --image us-central1-docker.pkg.dev/notely-453912/notely-ar-repo/notely:latest --region s-central1 --allow-unauthenticated --project notely-453912 --max-instances=4