Skip to content

Commit 0daa7a4

Browse files
authored
Deploy MkDocs site using GitHub Actions (#692)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent ae6e79e commit 0daa7a4

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/website.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,34 @@ on:
33
push:
44
branches:
55
- main
6+
workflow_dispatch:
7+
68
permissions:
7-
contents: write
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
817
jobs:
9-
# See https://squidfunk.github.io/mkdocs-material/publishing-your-site/
1018
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
1122
runs-on: ubuntu-latest
1223
steps:
1324
- uses: actions/checkout@v4
14-
- name: Configure Git Credentials
15-
run: |
16-
git config user.name github-actions[bot]
17-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
1825
- uses: actions/setup-python@v5
1926
with:
2027
python-version: 3.x
21-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22-
- uses: actions/cache@v4
23-
with:
24-
key: mkdocs-material-${{ env.cache_id }}
25-
path: .cache
26-
restore-keys: |
27-
mkdocs-material-
2828
- run: pip install mkdocs-material
29-
- run: mkdocs gh-deploy --force
29+
- run: mkdocs build --config-file mkdocs.yml --strict --site-dir ./build/website
30+
- uses: actions/configure-pages@v5
31+
- uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: ./build/website
34+
- name: Deploy to GitHub Pages
35+
id: deployment
36+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)