-
Notifications
You must be signed in to change notification settings - Fork 35
53 lines (45 loc) · 1.48 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
name: GitHub Pages
on:
push:
branches:
- 'master'
workflow_dispatch:
repository_dispatch:
types: [build_documentation]
concurrency:
group: publish_gh_pages
cancel-in-progress: true
jobs:
docs:
name: "Deploy"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@main
- name: Dependencies
run: |
sudo apt update
sudo apt install -y python3-wheel python3-setuptools
pip install --break-system-packages --upgrade Jinja2
pip install --break-system-packages --user mkdocs
pip install --break-system-packages --user $(mkdocs get-deps)
pip install --break-system-packages --upgrade pygments
echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
- name: Configure Git
run: |
git config --global push.default upstream
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
- name: Build Mkdocs
run: |
mkdocs build
- name: Create and prepare gh-pages anew
run: |
git checkout --orphan gh-pages
rm -R `ls -A | grep -v -E "^(.git|site)$"`
mv site/* ./
- name: Commit and push
run: |
git add .
git commit -m "publish site"
git push --force --set-upstream origin gh-pages