Skip to content

Commit

Permalink
docs: automate docs deployment on update (#196)
Browse files Browse the repository at this point in the history
This adds a new workflow to GitHub Actions.

The action deploys an updated version of the documentation to GitHub
Pages.

It is triggered when changes are pushed to 'mkdocs.yaml' or anything
under the 'docs' folder on the 'main' branch.

This is necessary to make the docs up-to-date with our code, without
manual intervention.

Tested on my fork, although it required some tweaking there to adjust it
for testing purposes, so it might take some troubleshooting here in the
upstream.

Signed-off-by: Jacob Emery <jacob.emery@ibm.com>
  • Loading branch information
jacobemery authored Sep 8, 2023
1 parent d62b453 commit 7e7c497
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- main
paths:
- 'mkdocs.yaml'
- 'docs/**'

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install mkdocs
run: pip install mkdocs

- name: Deploy docs
run: python3 -m mkdocs gh-deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7e7c497

Please sign in to comment.