Skip to content

Workflow file for this run

name: Upload Python Package and Docker Image
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine hatch
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# Build docker images
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push jupyterlab-sparglim
id: docker_build_jupyterlab_sparglim
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile.jupyterlab-sparglim
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jupyterlab-sparglim:${{ github.ref_name }}
-
name: Build and push sparglim-server
id: docker_build_sparglim_server
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile.sparglim-server
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sparglim-server:${{ github.ref_name }}
# Build latest if release
-
name: Build and push jupyterlab-sparglim_latest
if: '!github.event.release.prerelease'
id: docker_build_jupyterlab_sparglim_latest
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile.jupyterlab-sparglim
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jupyterlab-sparglim:latest
-
name: Build and push sparglim-server_latest
if: '!github.event.release.prerelease'
id: docker_build_sparglim_server_latest
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile.sparglim-server
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/sparglim-server:latest