correct deployment #6
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 prod | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: prod | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: log in to GCP | |
id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: access_token | |
project_id: ${{ secrets.PROJECT_ID }} | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.DEPLOY_SERVICE_ACCOUNT }} | |
- name: 'Set up gcloud' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: Build & deploy site | |
run: | | |
sudo apt install hugo | |
hugo | |
hugo deploy | |
gcloud compute url-maps invalidate-cdn-cache blog-prod --path "/*" --async |