Skip to content

Commit

Permalink
build(cd): setup auto deploy to production
Browse files Browse the repository at this point in the history
  • Loading branch information
asmahood committed Oct 23, 2023
1 parent 5a83266 commit 85daff1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Docker image
name: Publish And Deploy
on:
release:
types: [created]
Expand Down Expand Up @@ -26,3 +26,15 @@ jobs:
run: docker push us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT }}/uwpokerclub-docker/api:${GITHUB_REF##*/}
- name: Push the latest Docker image
run: docker push us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT }}/uwpokerclub-docker/api:latest
deploy:
name: Deploy version to Google Cloud
runs-on: ubuntu-latest
needs: push_to_artifact_registry
steps:
- name: Authenticate to GCP
uses: google-github-actions/auth@v1
with:
workload_identity_provider: '${{ secrets.GCP_WIP }}'
service_account: '${{ secrets.GCP_SA }}'
- name: Deploy
run: gcloud run deploy api-golang --image=us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT }}/uwpokerclub-docker/api:${GITHUB_REF##*/}

0 comments on commit 85daff1

Please sign in to comment.