Skip to content

Commit 087b9dc

Browse files
committed
squash-me, tag images with hash, not date, and handle PR builds differently
1 parent f6039fb commit 087b9dc

File tree

3 files changed

+99
-43
lines changed

3 files changed

+99
-43
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

+14-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ name: Build & Publish Notebook Servers (TEMPLATE)
99
required: true
1010
description: "make target to build"
1111
type: string
12+
event_name:
13+
required: true
14+
description: "top workflow's `github.event_name`"
15+
type: string
1216

1317
jobs:
1418
build:
@@ -54,10 +58,19 @@ jobs:
5458
# podman bug? need to create this _after_ doing the reset
5559
mkdir -p /mnt/containers/tmp
5660
57-
- run: "make ${{ inputs.target }}"
61+
- run: "push: make ${{ inputs.target }}"
62+
if: ${{ inputs.event_name == 'push' }}
5863
env:
64+
IMAGE_TAG: "${{ github.ref_name }}--${{ github.sha }}"
5965
IMAGE_REGISTRY: "ghcr.io/${{ github.repository }}/workbench-images"
6066
CACHE: "ghcr.io/${{ github.repository }}/workbench-images/build-cache"
6167

68+
- run: "pull_request: make ${{ inputs.target }}"
69+
if: ${{ inputs.event_name == 'pull_request' }}
70+
env:
71+
IMAGE_TAG: "${{ github.ref_name }}--${{ github.sha }}"
72+
IMAGE_REGISTRY: "ghcr.io/${{ github.repository }}/workbench-images/pr"
73+
CACHE: "ghcr.io/${{ github.repository }}/workbench-images/build-cache"
74+
6275
- run: df -h
6376
if: "${{ !cancelled() }}"

0 commit comments

Comments
 (0)