Re-enable secure: always #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: Publish a website directory to a private Gen website. | |
on: | |
# allow this workflow to be triggered manually from the GitHub UI | |
workflow_dispatch: | |
# trigger this workflow on every push to `main` | |
push: | |
branches: | |
- main | |
jobs: | |
Deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
env: | |
WEBSITE_DIR: './public' | |
steps: | |
- uses: 'actions/checkout@v4' | |
- name: Authenticate with Google Cloud | |
uses: 'google-github-actions/[email protected]' | |
with: | |
project_id: 'probcomp-caliban' | |
workload_identity_provider: 'projects/110275315150/locations/global/workloadIdentityPools/gen-website-private-publishers/providers/github' | |
service_account: 'gen-website-private-admin@probcomp-caliban.iam.gserviceaccount.com' | |
audience: '//iam.googleapis.com/projects/110275315150/locations/global/workloadIdentityPools/gen-website-private-publishers/providers/github' | |
- name: Deploy to Google Cloud Storage | |
run: | | |
gcloud storage rsync --recursive --cache-control 'public, max-age=60' $WEBSITE_DIR gs://gen-website-private/${{github.repository}} | |
- name: Ensure Domain Mapping | |
run: | | |
REPOSITORY_NAME=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2) | |
./scripts/ensure_domain_mapping.sh ${REPOSITORY_NAME}.gen.dev |