From d5b8f54abf44b39ddc35af2afde8d3bb25a553b7 Mon Sep 17 00:00:00 2001 From: "Kamil Mankowski (kam193)" Date: Mon, 27 Nov 2023 21:11:16 +0100 Subject: [PATCH] Try verify if container exist --- .github/workflows/build.yaml | 9 ++++++--- common.mk | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 04f0375..89e0a74 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,6 +6,7 @@ on: env: BASE_IMAGE: cccs/assemblyline-v4-service-base:stable REGISTRY: ghcr.io + BASE_TAG: 4.4.0.stable jobs: discover-services: @@ -54,10 +55,12 @@ jobs: if: steps.check-service-changed.outputs.exit-code != 0 run: | make test - - name: Check VERSION file was changed in the commit - id: check-version-changed + - name: Check if the current version has already been pushed + id: check-if-pushed run: | - git diff --quiet ${{ github.event.before }} ${{ github.event.after }} -- ${{ matrix.service }}/VERSION + export GHCR_TOKEN=$(echo $GITHUB_TOKEN | base64) + export TAG=$BASE_TAG$(cat VERSION) + curl -H "Authorization: Bearer ${GHCR_TOKEN}" https://ghcr.io/v2/kam193/${{ matrix.service }}/manifests/$TAG - name: Push container if: steps.check-version-changed.outputs.exit-code != 0 run: | diff --git a/common.mk b/common.mk index 217a023..ab1f68c 100644 --- a/common.mk +++ b/common.mk @@ -2,7 +2,7 @@ REGISTRY?= PUSH_REGISTRY?= BASE_IMAGE?=${REGISTRY}/cccs/assemblyline-v4-service-base:stable SERVICE_NAME=assemblyline-service-template -BASE_TAG=4.4.0.stable +BASE_TAG?=4.4.0.stable manifest: sed -i "s/assemblyline-service-template/${SERVICE_NAME}/g" service_manifest.yml