2022-03-10 03:27:31 -05:00
|
|
|
name: Render PEPs
|
2021-06-08 19:11:26 -04:00
|
|
|
|
2022-01-21 06:37:08 -05:00
|
|
|
on: [push, pull_request, workflow_dispatch]
|
2021-06-08 19:11:26 -04:00
|
|
|
|
|
|
|
jobs:
|
2022-03-10 03:27:31 -05:00
|
|
|
render-peps:
|
|
|
|
name: Render PEPs
|
2021-06-08 19:11:26 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: 🛎️ Checkout
|
2022-03-10 20:24:29 -05:00
|
|
|
uses: actions/checkout@v3
|
2021-07-04 13:55:04 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # fetch all history so that last modified date-times are accurate
|
2021-06-08 19:11:26 -04:00
|
|
|
|
2022-01-09 13:07:03 -05:00
|
|
|
- name: 🐍 Set up Python 3
|
2022-03-10 20:24:29 -05:00
|
|
|
uses: actions/setup-python@v3
|
2021-06-08 19:11:26 -04:00
|
|
|
with:
|
2022-01-31 21:49:58 -05:00
|
|
|
python-version: '3.x'
|
2022-01-09 13:07:03 -05:00
|
|
|
cache: "pip"
|
2021-06-08 19:11:26 -04:00
|
|
|
|
|
|
|
- name: 👷 Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
|
2022-03-10 03:27:31 -05:00
|
|
|
- name: 🔧 Render PEPs
|
2021-06-08 19:11:26 -04:00
|
|
|
run: make pages -j$(nproc)
|
|
|
|
|
2021-06-30 15:19:44 -04:00
|
|
|
# remove the .doctrees folder when building for deployment as it takes two thirds of disk space
|
|
|
|
- name: 🔥 Clean up files
|
|
|
|
run: rm -r build/.doctrees/
|
|
|
|
|
2021-06-08 19:11:26 -04:00
|
|
|
- name: 🚀 Deploy to GitHub pages
|
2022-01-21 06:37:08 -05:00
|
|
|
# This allows CI to build branches for testing
|
|
|
|
if: github.ref == 'refs/heads/main'
|
2022-01-31 21:49:58 -05:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.2.2
|
2021-06-08 19:11:26 -04:00
|
|
|
with:
|
|
|
|
branch: gh-pages # The branch to deploy to.
|
|
|
|
folder: build # Synchronise with build.py -> build_directory
|
|
|
|
single-commit: true # Delete existing files
|
2022-04-14 13:36:47 -04:00
|
|
|
|
|
|
|
- name: ♻️ Purge CDN cache
|
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
run: |
|
|
|
|
curl -H "Accept: application/json" -H "Fastly-Key: $FASTLY_TOKEN" -X POST "https://api.fastly.com/service/$FASTLY_SERVICE_ID/purge_all"
|
|
|
|
env:
|
|
|
|
FASTLY_TOKEN: ${{ secrets.FASTLY_TOKEN }}
|
|
|
|
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
|