generated from friendly-fhir/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 1.86 KB
/
deploy-github-pages.yaml
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Deploy Github Pages
on:
push:
branches: [master]
permissions:
contents: read
pages: write
id-token: write
jobs:
generate-documentation:
name: Generate Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Read metadata
id: metadata
run: |
site_dir=$(yq '.site_dir // "dist"' mkdocs.yaml)
echo "site-dir=${site_dir}" >> "${GITHUB_OUTPUT}"
- name: Install dependencies
run: |
pip install mkdocs
pip install mkdocs-mermaid2-plugin
pip install mkdocs-coverage
- name: Generate Documentation
run: mkdocs build
# Some of the doc generation steps above create the directories with
# 0750 for permissions -- which is triggering warning annotations in the
# workflow summaries. Manually converting this to 0755 helps to suppress
# this.
- name: Fix permissions
run: |
site_dir="${{ steps.metadata.outputs.site-dir }}"
find "./${site_dir}" -type d -exec chmod 0755 {} \;
find "./${site_dir}" -type f -name '.lock' -delete
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ steps.metadata.outputs.site-dir }}/
deploy:
name: Deploy to GH Pages
runs-on: ubuntu-latest
needs: generate-documentation
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Upload GH Pages
id: deployment
uses: actions/deploy-pages@v4