-
Notifications
You must be signed in to change notification settings - Fork 170
77 lines (66 loc) · 2.17 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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/actions-netlify@v1.1
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