Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit 0b9def2

Browse files
committed
feat: Add GitHub Actions workflow for documentation publishing
- Add .github/workflows/docs.yml for automatic documentation deployment - Configure workflow to build and deploy MkDocs site to GitHub Pages - Add docs/requirements.txt with MkDocs dependencies - Enable automatic deployment on pushes to main branch - Support manual workflow dispatch and PR testing - Documentation will be available at https://s-celles.github.io/cookiecutter-python-package/
1 parent 72f454a commit 0b9def2

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: 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+
workflow_dispatch:
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+
33+
- name: Setup Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.11'
37+
cache: 'pip'
38+
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install -r docs/requirements.txt
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v5
46+
47+
- name: Build documentation
48+
run: mkdocs build --clean --strict
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: site
54+
55+
deploy:
56+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mkdocs>=1.5.0
2+
mkdocs-material>=9.0.0
3+
mkdocs-git-revision-date-localized-plugin>=1.2.0

0 commit comments

Comments
 (0)