-
-
Notifications
You must be signed in to change notification settings - Fork 16
103 lines (95 loc) · 2.82 KB
/
gh-pages.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Requires GitHub Pages publishing branch to be `gh-pages`
name: GitHub Pages
on:
pull_request:
types:
# - edited # PR's base branch was changed
- opened
- reopened
- synchronize # PR's branch was edited (i.e. new commits)
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
path-filter:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@v2
with:
filters: |
changes:
- 'docs/**'
- '**/*.md'
- 'mkdocs.yml'
lint:
needs:
- path-filter
if: ${{ needs.path-filter.outputs.changes == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker run --rm --volume "${PWD}:/workdir" ghcr.io/igorshubovych/markdownlint-cli:latest --disable MD013 MD033 MD046 -- "**/*.md"
build:
needs:
- path-filter
if: ${{ github.event_name == 'pull_request' && needs.path-filter.outputs.changes == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# the `git-revision-date-localized` plugin needs full history to find page creation date
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- run: |
pip install --requirement docs/requirements.txt
sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- run: mkdocs build --strict --verbose
# !!! This check should be required by GitHub !!!
pages-status-check:
if: always()
needs:
- path-filter
- lint
- build
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
allowed-skips: lint, build
jobs: ${{ toJSON(needs) }}
deploy:
if: github.event_name == 'release'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
# the `git-revision-date-localized` plugin needs full history to find page creation date
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- run: |
pip install --requirement docs/requirements.txt
sudo apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
- run: mkdocs gh-deploy --strict --verbose --force