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
|
2022-07-31 06:34:28 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python-version: ["3.x", "3.11-dev"]
|
2021-06-08 19:11:26 -04:00
|
|
|
|
|
|
|
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-07-31 06:34:28 -04:00
|
|
|
- name: 🐍 Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
2021-06-08 19:11:26 -04:00
|
|
|
with:
|
2022-07-31 06:34:28 -04:00
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
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
|
2023-01-19 09:39:28 -05:00
|
|
|
run: make dirhtml JOBS=$(nproc)
|
2021-06-08 19:11:26 -04:00
|
|
|
|
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
|
2022-07-31 06:34:28 -04:00
|
|
|
if: (github.ref == 'refs/heads/main') && (matrix.python-version == '3.x')
|
|
|
|
uses: JamesIves/github-pages-deploy-action@v4
|
2021-06-08 19:11:26 -04:00
|
|
|
with:
|
|
|
|
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 }}
|