adding v6.1 DOI #12
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: Documentation | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
test: | |
name: Test the current branch | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: 'true' | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: _wssphinx | |
environment-file: docs/environment.yml | |
python-version: '3.9' | |
auto-activate-base: false | |
- run: | | |
conda info | |
- name: Build docs | |
run: | | |
sphinx-build -W --keep-going -b html docs ${{ runner.temp }} | |
build: | |
name: Build all branches | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: 'true' | |
fetch-depth: 0 | |
- name: Get branch name | |
run: | | |
branch=$(echo ${{ github.ref }} | sed 's:.*/::') | |
echo "BRANCH=$branch" >> $GITHUB_ENV | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: _wssphinx | |
environment-file: docs/environment.yml | |
python-version: '3.9' | |
auto-activate-base: false | |
- run: | | |
conda info | |
- name: Create build directory | |
run: echo "BUILD_DIR=$(mktemp -d -t pages-XXXXXXXXXX)" >> $GITHUB_ENV | |
- name: Build docs | |
run: | | |
sphinx-multiversion docs ${{ env.BUILD_DIR }} | |
touch ${{ env.BUILD_DIR }}/.nojekyll | |
cp docs/_assets/gh-pages.gitignore ${{ env.BUILD_DIR }}/.gitignore | |
cp docs/_assets/gh-pages-redirect.html ${{ env.BUILD_DIR }}/index.html | |
cp docs/_assets/gh-pages-readme.md ${{ env.BUILD_DIR }}/README.md | |
mkdir ${{ env.BUILD_DIR }}/master | |
cp docs/_assets/gh-pages-redirect.html ${{ env.BUILD_DIR }}/master/index.html | |
- name: Deploy | |
if: ${{ github.event_name == 'push' && (env.BRANCH == 'dev' || env.BRANCH == 'main') }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{ env.BUILD_DIR }} | |
force_orphan: true |