ci: add commit sha to image #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Cloud Run | |
on: | |
push: | |
branches: | |
- main | |
# This ensures only one deployment job runs at a time | |
# If a second deployment is triggered, it will cancel the first one | |
concurrency: | |
group: deploy-to-cloud-run | |
cancel-in-progress: true | |
env: | |
PROJECT_ID: coder-labeler | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21" # Adjust this to your Go version | |
- name: Google Auth | |
id: auth | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.GCP_SA_KEY }}" | |
- name: Set up Cloud SDK | |
uses: "google-github-actions/setup-gcloud@v1" | |
- name: Configure Docker | |
run: gcloud auth configure-docker us-central1-docker.pkg.dev | |
- name: Deploy using Makefile | |
run: make deploy |