From 1cd32354041baccb936784d98a3fb2926be0f1b1 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 10:20:11 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20make=20docker-push=20workfl?= =?UTF-8?q?ow=20self-contained=20by=20computing=20deps=5Fhash=20internally?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-cd.yaml | 2 +- .gitea/workflows/docker-push.yaml | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index 637b667..2af0d9b 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -323,5 +323,5 @@ jobs: -H "Authorization: token ${{ secrets.GITEA_TOKEN || secrets.PACKAGES_TOKEN }}" \ -H "Content-Type: application/json" \ "${{ env.GITEA_INTERNAL }}api/v1/repos/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}/actions/workflows/docker-push.yaml/dispatches" \ - -d '{"ref":"${{ github.ref }}","inputs":{"deps_hash":"${{ needs.build-cache.outputs.deps_hash }}","ref":"${{ github.ref }}"}}' + -d '{"ref":"${{ github.ref }}"}' echo "✅ Docker Push workflow triggered successfully!" diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 8cf19f2..472f035 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -6,13 +6,9 @@ name: Docker Push on: - # Manual trigger only - no automatic triggers + # Manual trigger for testing or production workflow_dispatch: inputs: - deps_hash: - description: 'Dependency hash from build-cache job' - required: true - type: string ref: description: 'Git reference (branch/tag)' required: false @@ -45,13 +41,21 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.PACKAGES_TOKEN }} + - name: Calculate dependency hash + id: calc_hash + run: | + # Calculate dependency hash (same method as build-cache job) + DEPS_HASH=$(sha256sum go.mod go.sum docker/Dockerfile.build | sha256sum | cut -d' ' -f1 | head -c 12) + echo "Dependency hash: $DEPS_HASH" + echo "deps_hash=$DEPS_HASH" >> $GITHUB_OUTPUT + - name: Build and push Docker image run: | source VERSION IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" - # Use the provided dependency hash - DEPS_HASH="${{ github.event.inputs.deps_hash }}" + # Use the calculated dependency hash + DEPS_HASH="${{ steps.calc_hash.outputs.deps_hash }}" echo "Using dependency hash: $DEPS_HASH" # Create Dockerfile.prod from template