Skip to content

Build docs

Build docs #32

Workflow file for this run

name: Build docs
on:
workflow_dispatch:
inputs:
branch:
description: 'branch where to source and build documentation'
required: false
default: 'dev'
release:
description: 'release version tag (#.#.#)'
required: false
default: '""'
jobs:
checkout-components:
strategy:
matrix:
components:
- artemis
- gr4
- rfm
- smart
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: checkout ${{ matrix.components }} component for unifhy
uses: actions/checkout@v2
with:
repository: unifhy-org/unifhycontrib-${{ matrix.components }}
- name: store ${{ matrix.components }} as artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.components }}
path: unifhycontrib/${{ matrix.components }}
build-docs:
needs: checkout-components
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: checkout framework repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: bring back all component artifacts
uses: actions/download-artifact@v2
with:
path: unifhycontrib
- name: set up miniconda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: building-docs-env
python-version: ${{ matrix.python-version }}
auto-update-conda: true
mamba-version: "*"
channels: conda-forge
channel-priority: true
- name: install dependencies for framework and its documentation
run: |
mamba install --file=requirements-docs.txt
- name: setup git user info
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: fetch remote tags
run: |
git fetch --tags
- name: build docs
run: |
if [[ ! -z ${{ github.event.inputs.release }} ]]; then export VERSION_RELEASE=${{ github.event.inputs.release }}; fi
cd ${{ github.workspace }}/docs
make github_html
- name: commit and push built docs (if changes)
run: |
cd ${{ github.workspace }}/docs
added=$(git add --all --verbose)
if [[ ! -z $added ]]; then git commit -m "update html documentation"; fi
if [[ ! -z $added ]]; then git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git ${{ github.event.inputs.branch }}; fi