Skip to content

Commit c65a2b3

Browse files
Update GitHub Actions workflow for MkDocs deployment
Signed-off-by: Hunter T. <[email protected]>
1 parent b9b1fa4 commit c65a2b3

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

.github/workflows/mkdocs-deploy.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,47 @@ name: Deploy Bash Style Guide GitHub Page
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: [ main ]
66
workflow_dispatch:
77

88
permissions:
9-
contents: write
9+
contents: read
1010

1111
jobs:
12-
deploy:
12+
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v5
15+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
1616
with:
1717
fetch-depth: 0
1818

1919
- name: Install uv
20-
uses: astral-sh/setup-uv@v6
20+
uses: astral-sh/setup-uv@eb1897b8dc4b5d5bfe39a428a8f2304605e0983c # v7
2121

2222
- name: Install the project
2323
run: uv sync --locked
2424

2525
- name: Build the site with MkDocs
2626
run: uv run mkdocs build --strict
2727

28+
- name: Upload static files as artifact
29+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
30+
with:
31+
path: ./site
32+
33+
deploy:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
37+
permissions:
38+
pages: write
39+
id-token: write
40+
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
45+
steps:
2846
- name: Deploy to GitHub Pages
29-
run: uv run mkdocs gh-deploy --force
47+
id: deployment
48+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

0 commit comments

Comments
 (0)