Skip to content

Commit c88828a

Browse files
authored
Merge pull request #974 from aireilly/mkdocs
fix CI
2 parents 51a32fc + ed3c342 commit c88828a

File tree

2 files changed

+22
-40
lines changed

2 files changed

+22
-40
lines changed
Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,15 @@
1-
name: Deploy MkDocs to GitHub Pages
2-
1+
name: Publish docs
32
on:
43
push:
5-
branches: [ main ]
6-
workflow_dispatch:
7-
8-
permissions:
9-
contents: read
10-
pages: write
11-
id-token: write
12-
13-
concurrency:
14-
group: "pages"
15-
cancel-in-progress: true
16-
4+
branches:
5+
- main
176
jobs:
18-
build:
7+
publication-builder:
8+
name: Build and publish to publication branch
199
runs-on: ubuntu-latest
20-
2110
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: "3.11"
29-
cache: "pip"
11+
- name: Checkout repository
12+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3013

3114
- name: Set up Ruby (for Asciidoctor CLI)
3215
uses: ruby/setup-ruby@v1
@@ -35,26 +18,25 @@ jobs:
3518
bundler-cache: false
3619

3720
- name: Install Asciidoctor + Rouge
38-
run: sudo gem install --no-document asciidoctor rouge
21+
run: gem install --no-document asciidoctor rouge
3922

40-
- name: Install MkDocs Python dependencies
41-
run: pip install -r requirements.txt
23+
- name: Install Python deps
24+
run: |
25+
python -m pip install -U pip
26+
pip install mkdocs mkdocs-material mkdocs-callouts mkdocs-asciidoctor-backend
4227
4328
- name: Build MkDocs site
4429
run: |
4530
python -m mkdocs build -f mkdocs.yml
4631
47-
- name: Upload artifact
48-
uses: actions/upload-pages-artifact@v3
32+
- name: Upload artifacts
33+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
4934
with:
5035
path: public
51-
52-
deploy:
53-
environment:
54-
name: github-pages
55-
url: ${{ steps.deploy.outputs.page_url }}
56-
runs-on: ubuntu-latest
57-
needs: build
58-
steps:
59-
- id: deploy
60-
uses: actions/deploy-pages@v4
36+
- name: Commit artifact to publication branch
37+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
38+
with:
39+
force_orphan: true # publish branch with only the latest commit
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_branch: publication
42+
publish_dir: public
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ serve_site() {
2222

2323
sync_sources
2424

25-
# Build in GitLab CI, otherwise serve locally
25+
# Build in CI, otherwise serve locally
2626
case "${1:-}" in
2727
--build) build_site ;;
2828
*)

0 commit comments

Comments
 (0)