-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (66 loc) · 2.47 KB
/
pages.yaml
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
name: Pages
on:
push:
branches:
- main
# workflow_dispatch allows the site to be rebuilt and published manually if needed
workflow_dispatch:
# 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
concurrency: pages-build-and-deploy
jobs:
build:
runs-on: ubuntu-latest
# Running this action on a fork will likely fail anyway
# unless the forked repo also has access to material for mkdocs insiders
if: github.event.repository.fork == false
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install pngquant
# The .cache directory is used for 3rd party assets, as part of the privacy plugin.
# It is also used to cache the generated social media cards.
# Persisting the cache across builds dramatically speeds up the process.
- name: Load site cache
uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
# We use poetry to manage mkdocs, plugins, etc
- name: Install poetry
run: pipx install poetry
- name: Setup Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.11"
# This ensures the package cache for poetry/pip is persisted, again speeding up this build action.
cache: "poetry"
# Insiders is the sponsorware version of Material for MkDocs
# https://squidfunk.github.io/mkdocs-material/insiders/
- name: Configure auth for Insiders
run: |
poetry config repositories.github-squidfunk-mkdocs https://github.com/squidfunk/mkdocs-material-insiders.git
poetry config http-basic.github-squidfunk-mkdocs username ${{ secrets.GH_TOKEN }}
- name: Install deps
run: poetry install
- name: Build site
run: poetry run mkdocs build
# Upload the built site as an artifact, this will be used by the deploy job.
- uses: actions/upload-pages-artifact@v2
with:
path: "site"
deploy:
needs: build
# 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