-
Notifications
You must be signed in to change notification settings - Fork 44
74 lines (68 loc) · 1.73 KB
/
publish_docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Publish docs
on:
push:
branches:
- main
workflow_dispatch:
repository_dispatch:
types: [publish-docs]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
outputs:
artifact: ${{ steps.mkdocs.outputs.artifact }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup config
uses: athackst/athackst.mkdocs@main
- name: Build and push docs to gh-pages
id: mkdocs
uses: athackst/mkdocs-simple-plugin@main
with:
push: false
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: 'github-pages'
path: ${{ steps.mkdocs.outputs.artifact }}
retention-days: 1
test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: github-pages
- name: Extract
run: |
mkdir _site
tar --directory _site -xvf ${{ needs.build.outputs.artifact }}
tree
- name: Test with htmlproofer
uses: athackst/htmlproofer-action@main
with:
ignore_urls: |
https://twitter.com/althack
https://fonts.gstatic.com
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build,test]
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4