singleuser-release #5
This file contains 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: singleuser-release | |
on: | |
workflow_dispatch: | |
inputs: | |
jupyterhub_version: | |
required: true | |
default: '4.0.2' | |
type: choice | |
options: | |
- '5.0.0' | |
- '4.0.2' | |
jobs: | |
release-image: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
# following python version end of life: https://devguide.python.org/versions/ | |
- py_ver: '3.11' | |
- py_ver: '3.10' | |
- py_ver: '3.9' | |
- py_ver: '3.8' | |
env: | |
PYTHON_VERSION: ${{matrix.py_ver}} | |
JUPYTERHUB_VERSION: ${{github.event.inputs.jupyterhub_version}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
submodules: true | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_TOKEN}} | |
- run: | | |
cd singleuser | |
docker compose build | |
export TAG_STUB=$(eval "echo \"$(cat docker-compose.yaml | grep image: | awk '{ print $2 }' | grep singleuser)\"") | |
export TARGET_TAG="${TAG_STUB}-$(git rev-parse --short HEAD)" | |
export LATEST_TAG="${TAG_STUB}-latest" | |
echo "target_tag=${TARGET_TAG}" >> $GITHUB_OUTPUT | |
echo "latest_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT | |
docker tag $TAG_STUB $TARGET_TAG | |
docker tag $TAG_STUB $LATEST_TAG | |
docker push $TARGET_TAG | |
docker push $LATEST_TAG | |
id: docker-build |