Skip to content

Commit 2680983

Browse files
committed
Added GitHub actions to build images; cleaned up dir structure for parameterized build
1 parent 73640fb commit 2680983

File tree

3 files changed

+71
-5
lines changed

3 files changed

+71
-5
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# .github/workflows/build.yml
2+
name: Build Jupyter Coder Images
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches: [ main ]
8+
paths:
9+
- "images/**"
10+
- ".github/workflows/build.yml"
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
base:
22+
- jupyter/minimal-notebook:latest
23+
- jupyter/scipy-notebook:latest
24+
# - jupyter/datascience-notebook:latest
25+
# - jupyter/tensorflow-notebook:latest
26+
# - jupyter/pytorch-notebook:latest
27+
# - jupyter/r-notebook:latest
28+
# - jupyter/all-spark-notebook:latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Log in to GHCR
39+
uses: docker/login-action@v3
40+
with:
41+
registry: ghcr.io
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Derive image names
46+
id: names
47+
run: |
48+
BASE="${{ matrix.base }}"
49+
# e.g., jupyter/scipy-notebook:latest -> scipy-notebook
50+
NAME="$(echo "$BASE" | awk -F'[/:]' '{print $(NF-1)}')"
51+
echo "name=$NAME" >> $GITHUB_OUTPUT
52+
# Tag scheme: ghcr.io/org/repo/<stack>:<upstream-tag>-coder
53+
OWNER="$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
54+
REPO="$(echo '${{ github.repository }}' | cut -d/ -f2 | tr '[:upper:]' '[:lower:]')"
55+
echo "image=ghcr.io/$OWNER/$REPO/$NAME" >> $GITHUB_OUTPUT
56+
57+
- name: Build & Push
58+
uses: docker/build-push-action@v6
59+
with:
60+
context: .
61+
file: images/jupyter/Dockerfile
62+
build-args: |
63+
BASE_IMAGE=${{ matrix.base }}
64+
platforms: linux/amd64
65+
push: true
66+
tags: |
67+
${{ steps.names.outputs.image }}:latest
68+
# Optional: mirror upstream tag (e.g., 2024-09-01), if you parse it.
69+
cache-from: type=gha
70+
cache-to: type=gha,mode=max
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apt-get update && \
1414
locales \
1515
sudo \
1616
rclone \
17-
&& rm -rf /var/lib/apt/lists/*
17+
&& rm -rf /var/lib/apt/lists/*
1818

1919
# Generate the desired locale (en_US.UTF-8)
2020
RUN locale-gen en_US.UTF-8

run-coder.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)