[GitHub]: Bump actions/deploy-pages from 2 to 4 (#136) #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Minchin.ca website | |
on: | |
push: | |
branches: | |
- pelican | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build Pelican site | |
runs-on: ubuntu-latest | |
steps: | |
# https://abbbi.github.io/actions/ | |
# disables some Ubuntu functionality that we don't need in a "throw away" runtime | |
- uses: abbbi/github-actions-tune@v1 | |
- name: Install (and Cache) Ubuntu packages | |
# includes updating apt sources | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: optipng libjpeg-progs | |
# libjpeg-progs for jpegtran | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Install Python | |
id: pthon-install | |
uses: actions/setup-python@v5 | |
with: | |
# supported versions: https://github.com/actions/python-versions/releases | |
python-version: 3.11 | |
cache: pip | |
cache-dependency-path: 'requirements.txt' | |
- name: Upgrade Pip, etc | |
run: python -m pip install pip setuptools wheel --upgrade | |
- name: Install invoke, etc | |
run: pip install invoke minchin.text | |
- name: Install pip-tools | |
run: pip install pip-tools | |
# - name: Install requirements (via invoke) | |
# run: invoke upgrade --requirements-file build --verbose | |
- name: Install requirements (via pip-sync) | |
run: pip-sync | |
- name: Build Site | |
run: invoke build --carefully --publish | |
- name: Upload Artifact (Built Site) | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./output | |
deploy: | |
# Add a dependency to the build job | |
needs: build | |
# 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 | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |