-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (63 loc) · 2.15 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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@v4
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@v2
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@v2