Skip to content

Commit

Permalink
automatically deploy to cloud run
Browse files Browse the repository at this point in the history
  • Loading branch information
Atomsoldat committed Jan 14, 2025
1 parent ac5232c commit bd99729
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
# define Hugo cachedir so it is not version dependent
HUGO_CACHEDIR: /tmp/hugo_cache
IMAGE_NAME: 'lichturm-website'
SERVICE_NAME: 'lichturm-website'
IMAGE_TAG: 'prod'
runs-on: 'ubuntu-latest'
steps:
Expand Down Expand Up @@ -57,9 +58,6 @@ jobs:
project_id: '${{ secrets.PROJECT_ID }}'
service_account: '${{ secrets.SERVICE_ACCOUNT }}'
workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}'
#project_id: bob
#service_account: 123
#workload_identity_provider: xyz

# https://github.com/docker/login-action
- name: Docker Auth
Expand All @@ -81,7 +79,7 @@ jobs:
buildkitd-flags: '--debug'

# https://github.com/docker/build-push-action
- name: Build and push
- name: Build and push image
uses: 'docker/build-push-action@v6'
with:
# we are not using the default git context because that would ignore our hugo build output
Expand All @@ -91,6 +89,15 @@ jobs:
push: true
tags: '${{ secrets.CONTAINER_REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}'

# https://github.com/google-github-actions/deploy-cloudrun
- name: Deploy Image to Cloud Run
id: 'deploy'
uses: 'google-github-actions/deploy-cloudrun@v2'
with:
service: '${{ env.SERVICE_NAME }}'
image: '${{ secrets.CONTAINER_REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}'
region: '${{ secrets.GCLOUD_REGION }}'

# once we are bored of building containers
# - name: Install s3cmd
# run: |
Expand Down

0 comments on commit bd99729

Please sign in to comment.