Skip to content

Commit fe6e39c

Browse files
authored
fix: Adding immutable tags and build of images after merge to master (#24)
* fix: Adding immutable tags and build of images after merge to master * feat: adapting the merged values, and fixing the immutability * feat: adapting the merged values, and fixing the immutability
1 parent d29e123 commit fe6e39c

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: nf-jdk build
22
on:
3-
schedule:
4-
- cron: "0 1 * * *"
3+
54
workflow_dispatch:
5+
push:
6+
branches: [main, master]
7+
paths:
8+
- 'Dockerfile*'
9+
- 'Makefile'
10+
- 'VERSION'
11+
- 'install-jemalloc.sh'
12+
- 'build-jemalloc.sh'
13+
- 'build-jemalloc-native.sh'
614

715
permissions:
816
id-token: write
@@ -59,8 +67,11 @@ jobs:
5967
username: ${{ secrets.SEQERA_CR_USERNAME }}
6068
password: ${{ secrets.SEQERA_CR_PASSWORD }}
6169

70+
- name: Set date tag (YYYYMMDD UTC)
71+
run: echo "DATE_TAG=$(date -u +%Y%m%d%H%M)" >> $GITHUB_ENV
72+
6273
- name: Build base image
63-
run: make build-base version=${{ matrix.version }}
74+
run: make build-base version=${{ matrix.version }} DATE_TAG=${{ env.DATE_TAG }}
6475

6576
build-jemalloc-container:
6677
needs: get-versions
@@ -94,5 +105,8 @@ jobs:
94105
username: ${{ secrets.SEQERA_CR_USERNAME }}
95106
password: ${{ secrets.SEQERA_CR_PASSWORD }}
96107

108+
- name: Set date tag (YYYYMMDD UTC)
109+
run: echo "DATE_TAG=$(date -u +%Y%m%d%H%M)" >> $GITHUB_ENV
110+
97111
- name: Build jemalloc image
98-
run: make build-jemalloc version=${{ matrix.version }}
112+
run: make build-jemalloc version=${{ matrix.version }} DATE_TAG=${{ env.DATE_TAG }}

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
repo = cr.seqera.io/public
22
version ?= $(shell cat VERSION)
33
image = nf-jdk:corretto-${version}
4+
image_jemalloc = nf-jdk:corretto-${version}-jemalloc
5+
6+
ifdef DATE_TAG
7+
immutable_tag = -t ${repo}/${image}-${DATE_TAG}
8+
immutable_tag_jemalloc = -t ${repo}/${image_jemalloc}-${DATE_TAG}
9+
endif
410

511
# Versions to build (single source of truth for CI matrix)
612
VERSIONS = 17-al2023 21-al2023 25-al2023
@@ -27,6 +33,7 @@ build-base:
2733
--platform linux/amd64,linux/arm64 \
2834
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
2935
-t ${repo}/${image} \
36+
$(immutable_tag) \
3037
-f Dockerfile \
3138
--push \
3239
.
@@ -38,6 +45,7 @@ build-jemalloc:
3845
--platform linux/amd64,linux/arm64 \
3946
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
4047
-t ${repo}/${image}-jemalloc \
48+
$(immutable_tag_jemalloc) \
4149
-f Dockerfile_jemalloc \
4250
--push \
4351
.

0 commit comments

Comments
 (0)