Skip to content

Build

Build #29

Workflow file for this run

name: "Build"
on:
workflow_dispatch:
schedule:
- cron: '5 4 1,15 * *' # At 04:05 on day-of-month 1 and 15.
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
website:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: Website
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get install \
libjson-xs-perl \
libtemplate-perl \
jq
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@v4
# Configure Workload Identity Federation via a credentials file.
- id: auth
name: 🔐 Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: 'projects/147435552396/locations/global/workloadIdentityPools/github-com/providers/github-com-oidc'
service_account: '[email protected]'
export_environment_variables: true
# Install gcloud, `setup-gcloud` automatically picks up authentication from `auth`.
# https://github.com/marketplace/actions/set-up-gcloud-cloud-sdk-environment
- name: '🔧 Set up Google Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
# Now you can run gcloud commands authenticated as the impersonated service account.
- name: Get roles
run: |
cd build || exit 9
bash roles.sh || exit 9
- name: Get permissions
run: |
cd build || exit 9
bash permissions.sh || exit 9
- name: Commit IAM changes
run: |
cd build || exit 9
bash commit.sh || exit 9
- name: Build website
run: |
cd build || exit 9
perl build.pl || exit 9
- name: Setup Pages
uses: actions/configure-pages@v5
# https://github.com/marketplace/actions/upload-github-pages-artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'web/'
# https://github.com/marketplace/actions/deploy-github-pages-site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4