Skip to content

Commit

Permalink
Add deploy docs workflow (#51)
Browse files Browse the repository at this point in the history
Add a workflow that deploys the documentation to gh-pages using 
`mkdocs gh-deploy`. We add it as a hatch script.

Fixes small typo in README.md
  • Loading branch information
agoscinski authored Dec 2, 2024
1 parent 610f4e3 commit 897faca
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: publish-docs
on:
push:
branches:
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.12

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: "Build and deploy docs to gh-pages"
run: |
pip install hatch
hatch run docs:deploy --force
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pip install -e .

## Developer tools

To manage the repo we use [hatch]{.title-ref} please install it
To manage the repo we use [hatch](https://hatch.pypa.io) please install it

``` bash
pip install hatch
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ license = {file = "LICENSE"}

[project.urls]
Repository = "https://github.com/C2SM/Sirocco.git"
Documentation = "https://c2sm.github.io/Sirocco/"
Changelog = "https://github.com/C2SM/Sirocco/blob/main/CHANGELOG.md"

[tool.pytest.ini_options]
Expand Down Expand Up @@ -92,3 +93,7 @@ build = [
serve = [
"mkdocs serve -f docs/mkdocs.yml",
]

deploy = [
"mkdocs gh-deploy -f docs/mkdocs.yml"
]

0 comments on commit 897faca

Please sign in to comment.