Skip to content

CQRP Policy V0.3.0

CQRP Policy V0.3.0 #58

Workflow file for this run

name: Build and Deploy Site
# Controls when the workflow will run
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains two jobs: "build" and "deploy"
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
# Install Python
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.13.1'
cache: 'pipenv'
# Install pipenv
- name: Install pipenv
run: pip install --upgrade pipenv wheel
# Runs a single command using the runners shell
- name: Build Site
id: build
env:
GH_TOKEN: ${{ github.token }}
run: |
pipenv install
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
echo $url
pipenv run python src/generate.py --context base_url $url
# Upload site, does not deploy
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: output_html/
# Deployment job
deploy:
needs: build
if: github.ref == 'refs/heads/main'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5