Skip to content

[pre-commit.ci] pre-commit autoupdate #1642

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #1642

Workflow file for this run

name: documentation
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v2
# See: https://github.com/marketplace/actions/setup-miniconda
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
environment-file: environment-dev.yml
miniforge-version: latest
- name: Install pyjanitor
# use editable mode to avoid _pytest.pathlib.ImportPathMismatchError
run: pip install -e .
- name: Build docs
run: mkdocs build
- uses: actions/upload-artifact@v3
with:
name: website
path: site/
- name: Test docs
run: pytest -m "documentation"
- name: Docs preview
if: ${{ github.event_name == 'pull_request' }}
uses: nwtgck/[email protected]
with:
publish-dir: "./site"
production-deploy: false
github-token: ${{ secrets.GHPAGES_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: false
overwrites-pull-request-comment: true
alias: deploy-preview-${{ github.event.number }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
- name: Deploy website
if: ${{ github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v3
with:
# https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
personal_token: ${{ secrets.GHPAGES_TOKEN }}
publish_dir: ./site/
publish_branch: gh-pages
# destination_dir: manuscript
allow_empty_commit: false
keep_files: false
force_orphan: true
enable_jekyll: false
disable_nojekyll: false