Generate api docs for EESSI test suite #408
Workflow file for this run
This file contains hidden or 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
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions | |
name: deploy documentation (only on push to main branch) | |
on: | |
push: | |
branches: main | |
# Add option to deploy manually, e.g. because there is a new EESSI test suite release and we want updated API docs | |
workflow_dispatch: | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
# Need to be able to write to the deploy branch | |
contents: write | |
steps: | |
- name: checkout | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
fetch-depth: 0 # need to fetch all history to ensure correct Git revision dates in docs | |
- name: set up Python | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
with: | |
python-version: '3.10' | |
- name: install mkdocs + plugins | |
run: | | |
pip install -r requirements.txt | |
pip list | grep mkdocs | |
mkdocs --version | |
# Make sure to also deploy auto-generated API docs for test suite | |
# For that, we need the repo to be available under eessi/test-suite | |
- name: checkout test suite | |
uses: actions/checkout@actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
repository: eessi/test-suite | |
# Path is needed, otherwise this will overwrite the checkout action that cloned the docs repo | |
path: test-suite | |
# Make sure to fetch tags, so we can checkout a particular release | |
fetch-tags: True | |
# Generate docs for latest release | |
run: | | |
cd eessi/tests-suite | |
# This assumes we stick to a version-tagging scheme vX.Y.Z | |
LATEST_VERSION=$(git tag | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1) | |
# Use the latest release by default | |
git checkout $LATEST_VERSION | |
- name: build tutorial | |
run: make test && make deploy |