Documentation generation #836
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
# This job generates the documentation under examples/ | |
name: Documentation generation | |
# Trigger the workflow manually | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
schedule: | |
- cron: "0 5 * * *" | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Run doc gen on MASTER branch | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
echo "generate documentation" | |
pip install -r requirements.txt | |
python docgen/parser.py | |
if [[ -z $(git status -s) ]] | |
then | |
echo "*** nothing to commit ***" | |
else | |
# Log into git | |
git config user.name "finbourne-bot" | |
git config user.email "[email protected]" | |
# Checkout branch and commit changes | |
branch_name='master' | |
git checkout $branch_name | |
git add . | |
git commit -m "Update examples documentation" | |
# Push branch back to remote | |
git push origin $branch_name | |
fi |