Skip to content

Commit 85e101b

Browse files
Merge pull request #33 from ricardogsilva/32-publish-docs-to-github-pages
Added CI workflow file for publishing docs to github actions
2 parents e328e3b + b1d2fff commit 85e101b

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
uses: actions/setup-python@v5.5.0
2020
with:
2121
python-version: "3.10"
22-
cache: pip
23-
cache-dependency-path: docker/backend/project_requirements.txt
22+
cache: poetry
2423

2524
- name: setup poetry
2625
uses: Gr1N/setup-poetry@v9

.github/workflows/docs.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build and publish Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- 'docs/**'
15+
16+
jobs:
17+
build-docs:
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- name: grab code
21+
uses: actions/checkout@v4.2.2
22+
23+
- name: setup Python
24+
uses: actions/setup-python@v5.5.0
25+
with:
26+
python-version: "3.10"
27+
cache: poetry
28+
29+
- name: setup poetry
30+
uses: Gr1N/setup-poetry@v9
31+
with:
32+
poetry-version: "2.1.1"
33+
34+
- name: install code with dev dependencies
35+
run: poetry install --with docs
36+
37+
- name: build docs
38+
run: poetry run mkdocs build --site-dir built-docs
39+
40+
- name: upload docs as artifacts
41+
uses: actions/upload-pages-artifact@v3.0.1
42+
with:
43+
path: built-docs/
44+
45+
deploy-docs:
46+
if: github.ref == 'refs/heads/main'
47+
needs: build-docs
48+
runs-on: ubuntu-24.04
49+
permissions:
50+
pages: write
51+
id-token: write
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- name: deploy docs to github pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4.0.5

0 commit comments

Comments
 (0)