-
Notifications
You must be signed in to change notification settings - Fork 15
76 lines (66 loc) · 2.47 KB
/
deploy.yml
File metadata and controls
76 lines (66 loc) · 2.47 KB
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
name: deploy
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
concurrency:
group: deploy_docs
cancel-in-progress: true
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
build-and-deploy-book:
permissions:
contents: write
id-token: write
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.13]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install docs dependency group
run: |
python -m pip install --upgrade pip
python -m pip install . --group docs
# Build and install the theme package.
- name: Build and install theme
env:
ENV: prod
run: |
python -m build
python -m pip install dist/napari_sphinx_theme*.whl
# Build the documentation.
- name: Build docs
env:
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
run: sphinx-build -b=html docs/ build/
# Deploy the book's HTML to github pages
- name: GitHub Pages action
if: github.repository == 'napari/napari-sphinx-theme' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
# If tagged version: Publish wheel to PyPI
- name: Publish to PyPI
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
# If tagged version: Update release on github repo
- uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && startsWith(github.ref, 'refs/tags')
with:
tag_name: ${{ github.ref }}
name: ${{ env.tag }}
files: |
dist/*
generate_release_notes: true