wip migration to mkdocs #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish docs via GitHub Pages | |
on: [push, pull_request] | |
env: | |
PACKAGE: digirock | |
jobs: | |
mkdocs_build_test_deploy: | |
name: build mkdocs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# required to use caching because it depends on requirements.txt | |
- name: create requirements | |
run: | | |
python -m pip install --upgrade pip | |
pip install pip_tools | |
pip-compile setup.cfg --extra docs | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install package and deps | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install . | |
- name: build docs | |
run: mkdocs build -f mkdocs.yml | |
- name: deploy mkdocs | |
if: success() && github.event_name == 'push' && github.ref_name == 'main' | |
run: mkdocs gh-deploy -f mkdocs.yml | |
test_badge: | |
name: create docs badges | |
if: always() && github.ref_name == 'main' | |
needs: [mkdocs_build_test_deploy] | |
runs-on: ubuntu-latest | |
steps: | |
- name: passed? | |
if: needs.mkdocs_build_test_deploy.result == 'success' | |
run: | | |
echo "BADGE_COLOUR=green" >> $GITHUB_ENV | |
echo "BADGE_MSG=pass" >> $GITHUB_ENV | |
- name: failed? | |
if: needs.mkdocs_build_test_deploy.result == 'failure' | |
run: | | |
echo "BADGE_COLOUR=RED" >> $GITHUB_ENV | |
echo "BADGE_MSG=fail" >> $GITHUB_ENV | |
- name: create test badges | |
if: | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_TOKEN }} | |
gistID: 0da415ee1bf30b0fc37a2fc4ddafbdee | |
filename: ${{ env.PACKAGE }}_docs.json | |
label: Docs | |
namedLogo: Read the Docs | |
logoColor: white | |
message: ${{ env.BADGE_MSG }} | |
color: ${{ env.BADGE_COLOUR }} |