-
Notifications
You must be signed in to change notification settings - Fork 6
59 lines (48 loc) · 1.64 KB
/
Copy pathmkdocs.yml
File metadata and controls
59 lines (48 loc) · 1.64 KB
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
---
name: Build and Deploy Documentation
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
mkdocs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.14'
- name: Install uv
run: |
python -m pip install --upgrade uv
- name: Install make
run: |
sudo apt-get update && sudo apt-get install -y make
- name: Build MkDocs site
run: make docs
- name: Set destination dir
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "DEST_DIR=preview/pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
else
echo "DEST_DIR=" >> $GITHUB_ENV
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
destination_dir: ${{ env.DEST_DIR }}
- name: Add preview link to step summary
if: github.event_name == 'pull_request'
run: |
PREVIEW_URL="https://${{ github.repository_owner }}.github.io/${GITHUB_REPOSITORY##*/}/preview/pr-${{ github.event.pull_request.number }}/"
echo "[$PREVIEW_URL]($PREVIEW_URL)" >> $GITHUB_STEP_SUMMARY