Skip to content

Commit 99ec593

Browse files
committed
Update publish workflow
1 parent d0476fa commit 99ec593

File tree

1 file changed

+42
-18
lines changed

1 file changed

+42
-18
lines changed

.github/workflows/publish.yaml

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
11
name: Publish
2+
23
on:
34
push:
45
branches:
56
- main
6-
permissions:
7-
contents: write
7+
88
jobs:
9-
deploy:
9+
build:
1010
runs-on: ubuntu-latest
11+
1112
steps:
12-
- uses: actions/checkout@v6
13-
- name: Configure Git Credentials
14-
run: |
15-
git config user.name github-actions[bot]
16-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
17-
- uses: actions/setup-python@v6
13+
- name: Checkout repository
14+
uses: actions/checkout@v6
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v6
1818
with:
19-
python-version: 3.x
20-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
21-
- uses: actions/cache@v5
19+
python-version: '3.x'
20+
21+
- name: Install dependencies
22+
run: |
23+
pip install -r docs/requirements.txt
24+
25+
- name: Build MkDocs site
26+
run: |
27+
mkdocs build
28+
29+
- name: Setup Pages
30+
uses: actions/configure-pages@v5
31+
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v4
2234
with:
23-
key: mkdocs-material-${{ env.cache_id }}
24-
path: ~/.cache
25-
restore-keys: |
26-
mkdocs-material-
27-
- run: pip install mkdocs-material
28-
- run: mkdocs gh-deploy --force
35+
path: ./site
36+
37+
deploy:
38+
runs-on: ubuntu-latest
39+
needs: build
40+
41+
permissions:
42+
pages: write
43+
id-token: write
44+
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)