-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (40 loc) · 1.27 KB
/
mkdocs-deploy.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
name: deploy-mkdocs
on:
push:
branches:
- develop # Triggers deployment on push to the main branch
jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' # Only deployed for the develop branch
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
mkdocs-bibtex-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material==8.1.1 pymdown-extensions mkdocs-click
- name: Build MKDocs Documentation
run: mkdocs build --verbose
- name: Deploy MKDocs to GitHub Pages
run: |
if [ -n "$GITHUB_TOKEN" ]; then
mkdocs gh-deploy --force
else
echo "Set the GH_PAGES_TOKEN secret in your repository for deploying to GitHub Pages."
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}