From c1d3a570f675a7315956da970616bd70f3f86a80 Mon Sep 17 00:00:00 2001 From: Markus Weigelt Date: Tue, 2 Jan 2024 16:43:56 +0100 Subject: [PATCH 1/2] Update Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7c4b9d9..8aedf6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ # github.com/OCR-D/core # https://hub.docker.com/r/ocrd/core/dockerfile # ocrd/core # ubuntu:18.04 -FROM ocrd/core:latest +ARG VERSION=latest +FROM ocrd/core:$VERSION ARG VCS_REF ARG BUILD_DATE From 01e745242acb0de6390614f1370ed951cc63aef3 Mon Sep 17 00:00:00 2001 From: Markus Weigelt Date: Wed, 10 Jan 2024 17:27:07 +0100 Subject: [PATCH 2/2] Add version as input parameter to the workflow and adjust cache key and build arguments --- .github/workflows/publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 21bbcce..a4b6eea 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,9 @@ on: image-tag: description: Tag name of Docker image default: 'latest' + ocrd-core-version: + description: Tag of ocrd/core from stage + default: 'latest' env: IMAGE_NAME: ghcr.io/${{ github.repository }} @@ -32,7 +35,7 @@ jobs: date -u +"build_date=%Y-%m-%dT%H:%M:%SZ" >> $GITHUB_ENV LOCAL_VSC_REF=`git rev-parse --short HEAD` echo "vcs_ref=$LOCAL_VSC_REF" >> $GITHUB_ENV - echo "cache_key=${{ github.event.inputs.image-tag }}-$LOCAL_VSC_REF" >> $GITHUB_ENV # (input image-tag - vcs_ref) + echo "cache_key=${{ github.event.inputs.image-tag }}-${{ github.event.inputs.ocrd-core-version }}-$LOCAL_VSC_REF" >> $GITHUB_ENV # (input image-tag - ocrd-core-version - vcs_ref) echo "$LOCAL_VSC_REF" > /tmp/${{ github.event.inputs.image-tag }}-vcs-ref # temporary file to fill cache - name: Get cache key "${{ env.cache_key }}" @@ -66,6 +69,7 @@ jobs: build-args: | BUILD_DATE=${{ env.build_date }} VCS_REF=${{ env.vcs_ref }} + VERSION=${{ github.event.inputs.ocrd-core-version }} cache-from: type=gha cache-to: type=gha,mode=max