forked from cosanlab/py-feat
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.54 KB
/
auto_deploy_on_release.yml
File metadata and controls
63 lines (53 loc) · 1.54 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
name: (Auto-On-Release) Deploy PyPi and Docs
on:
workflow_dispatch:
release:
types: [published]
jobs:
deploy:
name: Build & deploy package
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Pypa build
run: |
python3 -m pip install build --user
- name: Wheel and source build
run: |
python3 -m build --sdist --wheel --outdir dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
docs:
name: Build & deploy docs
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Install deps
run: |
python3 -m pip install . -r requirements-dev.txt
- name: Build book
run: |
jupyter-book build docs
echo 'py-feat.org' > ./docs/_build/html/CNAME
- name: Deploy docs
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html