-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (56 loc) · 1.9 KB
/
build_base_docker_image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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