-
Notifications
You must be signed in to change notification settings - Fork 79
58 lines (48 loc) · 2.01 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
name: Docs CI
on: [push, pull_request]
jobs:
docs:
# pull requests are a duplicate of a branch push if they are from within the
# same repo. Skip these
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
python-version: [3.8]
fail-fast: false
runs-on: ubuntu-latest
env:
TOX_DIRECT: 1
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # So we get history for version numbers
- name: Install Packages
run: sudo apt-get install graphviz
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e .[dev] && pipdeptree
- name: Build Docs
run: tox -e docs
- name: Upload built docs as artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: build
- name: Set env.REPOSITORY_NAME # just the repo, as opposed to org/repo
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Deploy documentation to blueskyproject.io.
if: github.repository_owner == 'bluesky' && github.ref_name == 'master'
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
deploy_key: ${{ secrets.ACTIONS_DOCUMENTATION_DEPLOY_KEY }}
publish_branch: master
publish_dir: build/html
external_repository: bluesky/bluesky.github.io
destination_dir: ${{ env.REPOSITORY_NAME }} # just the repo name, without the "bluesky/"
keep_files: true # Keep old files.
force_orphan: false # Keep git history.