Skip to content

Commit b8347eb

Browse files
committed
gh actions for mkdocs
1 parent 0163606 commit b8347eb

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

episodes/42-software-reuse.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,42 @@ This command assumes you have access to the GitHub repository of the current pro
407407

408408
Now go check your repository's GitHub Pages "Settings -> Pages", you should see the link to your documentation site, which should be like: `https://<github_user_id>.github.io/python-intermediate-inflammation/`. You can add this link to your GitHub repository landing page description.
409409

410+
411+
::::::::::::::::::::::::::::::::::::::::: callout
412+
413+
**Deploy documentation with GitHub actions**
414+
415+
It is also possible to automate the deployment of documentation site using GitHub Actions.
416+
417+
Below is an example of GitHub Actions workflow file to deploy the documentation site whenever there is a push to any branch in the repository. Note that a better practice is to only deploy the documentation when there is a update to the `main` branch, or when there is a new release.
418+
419+
```yaml
420+
name: Deploy docs
421+
422+
on: [push]
423+
424+
jobs:
425+
build:
426+
name: Deploy docs
427+
runs-on: ubuntu-latest
428+
steps:
429+
- name: Checkout main
430+
uses: actions/checkout@v4
431+
with:
432+
fetch-depth: 0
433+
- name: Set up Python 3.9
434+
uses: actions/setup-python@v5
435+
with:
436+
python-version: "3.9"
437+
- name: Install dependencies
438+
run: |
439+
python -m pip install .[docs]
440+
- name: Deploy docs
441+
run: mkdocs gh-deploy --force
442+
```
443+
444+
:::::::::::::::::::::::::::::::::::::::::
445+
410446
### Thinking about the audience for your documentation
411447

412448
Besides the API documentation we added by MKDocs, there are many different types of documentation you should consider

0 commit comments

Comments
 (0)