forked from dask/dask-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (74 loc) · 2.47 KB
/
build.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Docker build
on: [pull_request, push]
jobs:
docker:
runs-on: ubuntu-latest
env:
release: "2021.12.0"
defaultpython: "3.8"
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9"]
image:
- tag: "syoh/dask"
context: "./base"
- tag: "syoh/dask-notebook"
context: "./notebook"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver: docker
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.repository == 'dddlab/dask-docker' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Generate tags
id: tags
env:
image: ${{ matrix.image.tag }}
python: ${{ matrix.python }}
run: |
tags="${image}:${release}-py${python}"
if [ "$python" == "$defaultpython" ]; then
tags=${image}:latest,${image}:${release},$tags
fi
echo "::set-output name=tags::${tags}"
- name: Checkout upstream Jupyter Lab image repo
uses: actions/checkout@v2
if: matrix.image.tag == 'syoh/dask-notebook'
with:
repository: jupyter/docker-stacks
ref: master
path: docker-stacks
- name: Build upstream Jupyter Lab image
uses: docker/build-push-action@v2
if: matrix.image.tag == 'syoh/dask-notebook'
with:
context: ./docker-stacks/datascience-notebook
push: false
load: true
platforms: linux/amd64
tags: syoh/base-notebook:lab
build-args: |
PYTHON_VERSION=${{ matrix.python }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ${{ matrix.image.context }}
push: ${{ github.repository == 'dddlab/dask-docker' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
platforms: linux/amd64
tags: ${{ steps.tags.outputs.tags }}
build-args: |
python=${{ matrix.python }}
release=${{ env.release }}
base=syoh
- name: Report
run: echo Built ${{ steps.tags.outputs.tags }}