-
Notifications
You must be signed in to change notification settings - Fork 141
42 lines (40 loc) · 1.23 KB
/
docs.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
name: docs
on:
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/docs.yaml'
- 'mkdocs.yml'
permissions:
contents: read # for actions/checkout to fetch code
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: 3.x
- name: Install mkdocs
run: pip install mkdocs-material
- name: Generate docs artifacts
run: mkdocs build -d /tmp/docs
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
ref: gh-pages
path: gh-pages
- name: Publish docs artifacts to gh-pages
run: |
cd gh-pages
shopt -s extglob
rm -rf !(index.yaml|LICENSE|*.tgz)
cp -R /tmp/docs/** .
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "Publish docs from $GITHUB_SHA"
git push https://github.com/$GITHUB_REPOSITORY.git gh-pages