Skip to content

Commit 7cbf329

Browse files
authored
Add GitHub Actions workflow for documentation deployment (#20)
1 parent 8509698 commit 7cbf329

3 files changed

Lines changed: 77 additions & 47 deletions

File tree

.github/workflows/docs.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- '.github/workflows/docs.yml'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- 'docs/**'
14+
- 'mkdocs.yml'
15+
- '.github/workflows/docs.yml'
16+
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: false
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.x'
39+
40+
- name: Cache dependencies
41+
uses: actions/cache@v4
42+
with:
43+
key: mkdocs-material-${{ hashFiles('requirements.txt') }}
44+
path: ~/.cache/pip
45+
restore-keys: |
46+
mkdocs-material-
47+
48+
- name: Install dependencies
49+
run: |
50+
pip install mkdocs-material
51+
pip install mkdocs-minify-plugin
52+
53+
- name: Setup Pages
54+
id: pages
55+
uses: actions/configure-pages@v4
56+
57+
- name: Build documentation
58+
run: |
59+
mkdocs build --clean
60+
61+
- name: Upload artifact
62+
uses: actions/upload-pages-artifact@v3
63+
with:
64+
path: site
65+
66+
deploy:
67+
if: github.ref == 'refs/heads/main'
68+
needs: build
69+
runs-on: ubuntu-latest
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
steps:
74+
- name: Deploy to GitHub Pages
75+
id: deployment
76+
uses: actions/deploy-pages@v4

.github/workflows/mkdocs-material-gh-pages.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

LayeredCraft.Cdk.Constructs.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "git", "git", "{32F31203-71F
2121
.github\dependabot.yml = .github\dependabot.yml
2222
.github\workflows\build.yaml = .github\workflows\build.yaml
2323
.github\workflows\pr-build.yaml = .github\workflows\pr-build.yaml
24-
.github\workflows\mkdocs-material-gh-pages.yml = .github\workflows\mkdocs-material-gh-pages.yml
24+
.github\workflows\docs.yml = .github\workflows\docs.yml
2525
EndProjectSection
2626
EndProject
2727
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{B4C8E2F1-3A2D-4B8F-9C7E-1F5A8D9E2B3C}"

0 commit comments

Comments
 (0)