Skip to content

Merge pull request #2 from nronzel/ci-cd #2

Merge pull request #2 from nronzel/ci-cd

Merge pull request #2 from nronzel/ci-cd #2

Workflow file for this run

name: cd
on:
push:
branches: [main]
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build app
run: ./scripts/buildprod.sh
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Build & Push Docker Image
run: "gcloud builds submit --tag us-east1-docker.pkg.dev/xoracle/xoracle-repo/xoracle:latest ."
- name: Deploy to Cloud Run
run: "gcloud run deploy xoracle --image us-east1-docker.pkg.dev/xoracle/xoracle-repo/xoracle:latest --region us-east1 --allow-unauthenticated --project xoracle --max-instance=4"