Skip to content

Initialise site

Initialise site #100

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: ["master"]
permissions: {}
jobs:
build:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.14
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
uses: py-actions/py-dependency-install@v4
with:
path: requirements.txt
- name: Build site
run: pelican -s publishconf.py
- name: Build Pygments CSS
run: pygmentize -S default -f html > output/theme/css/pygment.css
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'output/'
deploy_preview:
if: "github.event_name == 'pull_request'"
runs-on: "ubuntu-latest"
needs: "build"
permissions:
pull-requests: write # For comments in PRs
steps:
- name: Download site artifact
uses: actions/download-artifact@v4
with:
# The name of artifacts created by `actions/upload-pages-artifact` is always "github-pages"
name: github-pages
path: 'output/'
- name: Untar site artifact
run: tar --directory output/ -xvf output/artifact.tar
- name: Deploy preview to Netlify
uses: nwtgck/actions-netlify@v2
env:
NETLIFY_SITE_ID: "${{ secrets.NETLIFY_SITE_ID }}"
NETLIFY_AUTH_TOKEN: "${{ secrets.NETLIFY_AUTH_TOKEN }}"
with:
publish-dir: 'output/'
timeout-minutes: 1
deploy:
if: "github.event_name == 'push'"
runs-on: "ubuntu-latest"
needs: "build"
permissions:
id-token: write # to verify the deployment originates from an appropriate source
pages: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4