Skip to content

build-documentation #136

build-documentation

build-documentation #136

Workflow file for this run

name: Documentation
on:
workflow_run:
workflows: [Run Tests]
types:
- completed
jobs:
build_docs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: nschloe/action-cached-lfs-checkout@v1
with:
ref: ${{ github.event.workflow_run.head_sha }}
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- name: Install dependency
run: |
sudo apt-get install -y pandoc
sudo pip install --upgrade pip
pip install --user sphinx==6.2.* pydata-sphinx-theme==0.13.* pandoc nbsphinx \
Pygments==2.14.0 sphinx-autodoc-typehints myst-parser \
markupsafe==2.1.1 sphinx-plotly-directive
- name: Download wheel files from artifacts
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ci.yml
commit: ${{ github.event.workflow_run.head_sha }}
name: wheel-files
path: wheel_files
- name: Install wheel files
run: pip install --user wheel_files/*.whl
- name: Build doc
run: sphinx-build ${GITHUB_WORKSPACE}/docs _build/html
- name: Get SnapATAC2 version
id: get_version
run: |
BRANCH_NAME=${{ github.event.workflow_run.head_branch }}
VERSION_NUMBER=$(python -c "import snapatac2;print(snapatac2.__version__)")
echo $VERSION_NUMBER
echo "VERSION=$VERSION_NUMBER" >> $GITHUB_ENV
if [[ $BRANCH_NAME =~ ^v[0-9]+ ]]; then
echo "DEPLOY_VERSION=true" >> $GITHUB_ENV
echo $DEPLOY_VERSION
fi
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ env.DEPLOY_VERSION != 'true' }}
with:
single-commit: true
branch: gh-pages
folder: _build/html
clean: true
clean-exclude: version
- name: Deploy (version)
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ env.DEPLOY_VERSION == 'true' }}
with:
single-commit: true
branch: gh-pages
folder: _build/html
target-folder: /version/${{ env.VERSION }}/
clean: true