fixing doc publishing #104
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
# Builds the Sphinx documentation | |
name: Docs Build | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- docs/** | |
- cneuromax/** | |
- .github/workflows/docs-build.yaml | |
jobs: | |
docs-build: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout the GitHub repo | |
uses: actions/checkout@v4 | |
- name: Build the CNeuroMax image | |
run: podman build -t cneuromod/cneuromax:docs -f Dockerfile . | |
- name: Build the documentation | |
run: > | |
podman run --rm -v $PWD:/cneuromax -w /cneuromax | |
cneuromod/cneuromax:docs | |
sphinx-build -b html ./docs/ ./docs/build/ | |
- name: Push the documentation | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "MaximilienLC" | |
rm -rf !("docs") | |
cp -r ./docs/build/* . | |
rm -rf ./docs ./.github | |
git add . | |
git commit -m "New documentation build" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
branch: gh-pages | |
force: true |