Merge pull request #230 from NeuroDevCo/cache-dict #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to PyPi and deploy documentation | |
| on: | |
| push: | |
| branches: [main] # branch to trigger deployment | |
| jobs: | |
| setup: | |
| name: Setup Python | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Build | |
| run: uv build | |
| - name: Store the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| publish: | |
| name: Upload release to PyPI | |
| runs-on: ubuntu-latest | |
| needs: | |
| - setup | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/babylab | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| pages: | |
| name: Deploy Sphinx docs | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Install sphinx_book_theme | |
| run: python -m pip install sphinx_book_theme | |
| - id: deployment | |
| uses: sphinx-notes/pages@v3 |