Change the documentation URL in README.md
and add commands to run e…
#1
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 | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- ".github/**" # Ignore changes towards the .github directory | |
workflow_dispatch: # run on request (no need for PR) | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
Build-and-Publish-Documentation: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: [docs] | |
steps: | |
- name: CHECKOUT REPOSITORY | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install requirements | |
run: | | |
pip install -r requirements/docs.txt | |
pip install ".[full]" | |
- name: Link dataset path to local directory as nbsphinx runs the notebook | |
run: ln -s $ANOMALIB_DATASET_PATH ./datasets | |
- name: Build and Commit Docs | |
run: | | |
cd docs | |
make html | |
cd .. | |
- name: Clean directory | |
run: | | |
mkdir -p /tmp/docs_build | |
cp -r docs/build/html/* /tmp/docs_build/ | |
rm -rf ./* | |
cp -r /tmp/docs_build/* ./ | |
rm -rf /tmp/docs_build | |
touch .nojekyll | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: "." | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |