Merge pull request #331 from Australian-Imaging-Service/t1w-preproc #120
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: generate docs | |
on: | |
push: | |
branches: | |
- main | |
repository_dispatch: # Allow access tokens which have write access to this repo to trigger this action | |
workflow_dispatch: # Allow manual triggering by a user with write access to this repo | |
jobs: | |
generate: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive # Fetch Hugo themes (true OR recursive) | |
fetch-depth: 1 # Fetch all history for .GitInfo and .Lastmod | |
# TODO: Need a unique key we can pass, but as we're targeting | |
# arcana@master, this is not trivial. | |
# | |
# - name: Cache dependencies | |
# uses: actions/cache@v1 | |
# with: | |
# path: ~/.local/lib | |
# key: ${{ runner.os }}-python-${{ hashFiles('**/package-lock.json') }} | |
# restore-keys: | | |
# ${{ runner.os }}-python- | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer' | |
- name: Install python dependencies | |
run: pip install -r ./requirements.txt | |
- name: Generate pipeline docs | |
run: arcana deploy make-docs ./australian-imaging-service docs/pipelines --flatten --default-data-space arcana.common:Clinical | |
- name: Remove /docs/pipelines/ from .gitignore | |
run: sed -i 's%^/docs/pipelines/\*$%%' .gitignore | |
- name: Deploy docs | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: . | |
publish_branch: docs | |
enable_jekyll: true # This branch isn't actually fed to GH pages | |
# It's possible, likely even, that we'll trigger unnecessary docs | |
# rebuilds with this. Running this properly as a separate workflow | |
# only when real docs changes occur would require using a PAT. | |
- name: Trigger rebuild of docs | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.GITHUBPAGES_KEY }} | |
repository: Australian-Imaging-Service/Australian-Imaging-Service.github.io | |
event-type: Rebuild docs |