Documentation to github pages #9
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
# This is a basic workflow to help you get started with Actions | |
name: Documentation to github pages | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
test_package: | |
name: Test package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: false | |
- name: Setup python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: "pip" | |
- name: Install nodify + test dependencies | |
run: | | |
python -m pip install -e .[test] | |
python -m pip install pytest-cov | |
- name: Run tests and collect coverage | |
run: cd src/nodify; pytest --cov=./ --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v3 | |
- name: Setup python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: "pip" | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install nodify + documentation dependencies | |
run: | | |
python -m pip install .[docs] | |
- name: Build the documentation | |
run: | | |
cd docs | |
make html | |
rm -rf _build/html/_sources | |
touch _build/html/.nojekyll | |
cd .. | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs/_build/html | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |