Skip to content

Commit 1ff504d

Browse files
committed
refactor: streamline MkDocs deployment workflow and update Python version
1 parent 394b278 commit 1ff504d

File tree

1 file changed

+53
-36
lines changed

1 file changed

+53
-36
lines changed

.github/workflows/doc.yaml

Lines changed: 53 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,62 @@
1-
name: Deploy Documentation to GitHub Pages
1+
name: Deploy MkDocs to GitHub Pages
22

33
on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
717

818
jobs:
9-
build-and-deploy:
19+
build:
1020
runs-on: ubuntu-latest
11-
1221
steps:
13-
- name: Free up disk space
14-
run: |
15-
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android
16-
docker system prune -af
17-
18-
- name: Checkout repository
19-
uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 0
22-
fetch-tags: true
23-
24-
- name: Set up Python
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version: '3.10'
28-
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install -e ".[dev,docs]"
33-
34-
- name: Build Cookbook
35-
run: |
36-
which mkdocs
37-
mkdocs --version
38-
mkdocs build
39-
40-
- name: Deploy to GitHub Pages
41-
uses: peaceiris/actions-gh-pages@v4
42-
with:
43-
github_token: ${{ secrets.GITHUB_TOKEN }}
44-
publish_dir: site
45-
cname: doc.agentjet.github.io
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Setup Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.11'
31+
32+
- name: Cache pip dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cache/pip
36+
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
37+
restore-keys: |
38+
${{ runner.os }}-pip-
39+
40+
- name: Install dependencies
41+
run: |
42+
pip install --upgrade pip
43+
pip install -r docs/requirements.txt
44+
45+
- name: Build documentation
46+
run: mkdocs build --clean
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
50+
with:
51+
path: ./site
52+
53+
deploy:
54+
environment:
55+
name: github-pages
56+
url: ${{ steps.deployment.outputs.page_url }}
57+
runs-on: ubuntu-latest
58+
needs: build
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)