Skip to content

Build base notebook image #110

Build base notebook image

Build base notebook image #110

name: Build base notebook 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: jupyter
file: jupyter/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
blsq/openhexa-base-notebook:${{ steps.version.outputs.number }}
blsq/openhexa-base-notebook:latest
- name: Build and push (manual)
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@v4
with:
push: true
context: jupyter
file: jupyter/Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
blsq/openhexa-base-notebook:${{ github.event.inputs.tag }}
blsq/openhexa-base-notebook:latest