Skip to content

Fix pixi install on self-hosted runners (#886) #897

Fix pixi install on self-hosted runners (#886)

Fix pixi install on self-hosted runners (#886) #897

Workflow file for this run

name: Documentation build and deploy
on:
push:
branches: [ master ]
tags: ['*']
pull_request:
branches: [ master ]
workflow_dispatch:
concurrency:
group: ci-docs-${{ github.ref }}
cancel-in-progress: true
jobs:
build-latest:
runs-on: ubuntu-latest
if: github.repository == 'anybody/ammr' || github.event_name != 'push'
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
manifest-path: Docs/pixi.toml
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
- name: Link check
run: |
cd Docs
pixi run sphinx-build -M linkcheck . _build -W --keep-going -a -q
- name: Build Documentation
run: |
cd Docs
pixi run sphinx-build -M html . _build -W --keep-going -a -t draft
- uses: actions/upload-artifact@v3
with:
name: beta-version
path: Docs/_build/html
build-tagged:
runs-on: ubuntu-latest
if: (github.repository == 'anybody/ammr' || github.event_name != 'push') && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Checkout last tagged version
run: |
git fetch --shallow-since=2020-07-07
git checkout $(git describe --tags `git rev-list --tags=ammr* --max-count=1`);
- uses: prefix-dev/[email protected]
continue-on-error: true
id: pixisetup
with:
manifest-path: Docs/pixi.toml
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
- name: Build Documentation
if: steps.pixisetup.outcome == 'success'
run: |
cd Docs
pixi run sphinx-build -M html . _build -a
# Fall back to mamba when buildig old versions
- name: Install mamba
if: steps.pixisetup.outcome == 'failure'
uses: mamba-org/setup-micromamba@v1
with:
environment-file: Docs/environment.yaml
- name: build with mamba
if: steps.pixisetup.outcome == 'failure'
shell: bash -leo pipefail {0} {0}
run: sphinx-build -M html Docs Docs/_build -a
- uses: actions/upload-artifact@v3
with:
name: tagged-version
path: Docs/_build/html
prepare-pages:
needs: [build-latest, build-tagged]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: tagged-version
path: public
- uses: actions/download-artifact@v3
with:
name: beta-version
path: public/beta
- uses: actions/upload-pages-artifact@v2
with:
path: public
deploy:
needs: prepare-pages
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2