Within Session splitter #2012
Workflow file for this run
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: Docs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: [ master, develop ] | |
pull_request: | |
branches: [ master, develop ] | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
build_docs: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ ubuntu-latest ] | |
python-version: [ "3.9" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
enable-cache: true | |
- name: Create/Restore MNE Data Cache | |
id: cache-mne_data | |
uses: actions/cache@v4 | |
with: | |
path: ~/mne_data | |
key: doc-${{ runner.os }}-mne-data-v1 | |
restore-keys: | | |
doc-${{ runner.os }}-mne-data-v1 | |
- name: Ensure MNE Data folder exists if cache fails | |
run: | | |
echo "Cache hit: ${{ steps.cache-mne_data.outputs.cache-hit }}" | |
mkdir -p ~/mne_data | |
- name: Cache docs build | |
id: cache-docs | |
uses: actions/cache@v3 | |
with: | |
key: docs-build-${{ github.run_id }}-${{ github.run_attempt }} | |
path: docs/build | |
- name: Install moabb | |
run: | | |
uv pip install -e .[docs,deeplearning,optuna] | |
- name: Build docs | |
run: | | |
cd docs && make html | |
# Create an artifact of the html output. | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: DocumentationHTML | |
path: docs/build/html/ | |
deploy_neurotechx: | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
needs: build_docs | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore cached docs build | |
id: cache-docs | |
uses: actions/cache/restore@v3 | |
with: | |
key: docs-build-${{ github.run_id }}-${{ github.run_attempt }} | |
path: docs/build | |
- name: Check cache hit | |
if: steps.cache-docs.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Deploy Neurotechx Subpage | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
external_repository: NeuroTechX/moabb.github.io | |
destination_dir: docs/ | |
publish_branch: master | |
publish_dir: ./docs/build/html | |
cname: moabb.neurotechx.com/ | |
deploy_gh_pages: | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
needs: build_docs | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore cached docs build | |
id: cache-docs | |
uses: actions/cache/restore@v3 | |
with: | |
key: docs-build-${{ github.run_id }}-${{ github.run_attempt }} | |
path: docs/build | |
- name: Check cache hit | |
if: steps.cache-docs.outputs.cache-hit != 'true' | |
run: exit 1 | |
- name: Deploy gh-pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
deploy_key: ${{ secrets.MOABB_DEPLOY_KEY_NEW }} | |
destination_dir: docs/ | |
publish_branch: gh-pages | |
publish_dir: ./docs/build/html | |
cname: neurotechx.github.io/moabb/ |