Skip to content

Build custom hub image #21

Build custom hub image

Build custom hub image #21

name: Build custom hub image
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
tag:
description: Image tag
required: true
jobs:
build:
runs-on: ubuntu-latest
# see https://github.com/docker/build-push-action
steps:
# Setup (see https://github.com/docker/build-push-action)
- name: Checkout
uses: actions/checkout@v2
- 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 }}
# Publish to Docker hub
- name: Store version number (on release)
if: ${{ github.event_name == 'release' }}
id: version
# GITHUB_REF looks like "refs/tags/0.3.1" - we need to extract the actual version without the v prefix
run: echo ::set-output name=number::${GITHUB_REF##*/}
- name: Build and push (on release)
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v4
with:
push: true
context: jupyterhub
file: jupyterhub/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
blsq/openhexa-jupyterhub:${{ steps.version.outputs.number }}
blsq/openhexa-jupyterhub:latest
- name: Build and push (manual)
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@v4
with:
push: true
context: jupyterhub
file: jupyterhub/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
blsq/openhexa-jupyterhub:${{ github.event.inputs.tag }}
blsq/openhexa-jupyterhub:latest