1+ name : " Continuous Deployment"
2+
3+ on :
4+ push :
5+ tags :
6+ - " *"
7+
8+ jobs :
9+
10+ # ############################################################################
11+ # Create and online deployment of the documentation #########################
12+ docs : # ######################################################################
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - name : Install Dependencies (pip)
18+ shell : bash
19+ run : |
20+ python -m pip install --upgrade pip
21+ python -m pip install .[docs]
22+
23+ - name : Build Documentation
24+ run : |
25+ make html
26+ working-directory : docs/
27+
28+ - name : Deploy
29+ uses : peaceiris/actions-gh-pages@v3
30+ with :
31+ github_token : ${{ secrets.GITHUB_TOKEN }}
32+ publish_dir : ./docs/build/html
33+ allow_empty_commit : true
34+
35+ # ############################################################################
36+ # # Publish the distribution to PyPI #########################################
37+ distribution_pypi : # #########################################################
38+ runs-on : ubuntu-latest
39+ steps :
40+ - uses : actions/checkout@v4
41+
42+ - name : Install build
43+ run : >-
44+ python -m pip install build --user
45+
46+ - name : Build a binary wheel and a source tarball
47+ run : >-
48+ python -m build --sdist --wheel --outdir dist/ .
49+
50+ - name : Publish distribution to PyPI
51+ if : startsWith(github.ref, 'refs/tags')
52+ uses : pypa/gh-action-pypi-publish@release/v1
53+ with :
54+ password : ${{ secrets.PYPI_API_TOKEN }}
55+
56+ # ############################################################################
57+ # # Create a public "Release" on the Github page #############################
58+ release_github : # ############################################################
59+ runs-on : ubuntu-latest
60+ permissions :
61+ contents : write
62+ steps :
63+ - uses : actions/checkout@v4
64+ - uses : ncipollo/release-action@v1
65+ with :
66+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments