diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 29f00ba..4f149c6 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -41,13 +41,7 @@ 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: Restore Swagger Docs Cache id: cache-swagger-restore @@ -65,9 +59,10 @@ jobs: if: steps.cache-swagger-restore.outputs.cache-hit != 'true' run: > docker run --rm - -v ${GITHUB_WORKSPACE}:/build - gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ steps.calc_hash.outputs.deps_hash }} - go generate ./pkg/server + -v ${GITHUB_WORKSPACE}:/workspace + -w /workspace + golang:1.26.1-alpine + sh -c "apk add git && go install github.com/swaggo/swag/cmd/swag@latest && go generate ./pkg/server" - name: Save Swagger Docs Cache if: steps.cache-swagger-restore.outputs.cache-hit != 'true' @@ -85,61 +80,11 @@ jobs: source VERSION IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" - # Use the calculated dependency hash and set it as environment variable - DEPS_HASH="${{ steps.calc_hash.outputs.deps_hash }}" - echo "Using dependency hash: $DEPS_HASH" - echo "DEPS_HASH=$DEPS_HASH" >> $GITHUB_ENV - TAGS="$IMAGE_VERSION latest ${{ github.sha }}" echo "Building Docker image with tags: $TAGS" - # Build the production image using inline version with prebuilt cache image - # Fixed: Use $GITHUB_ENV variable in the inline Dockerfile - docker build -t dance-lessons-coach -f - --build-arg DEPS_HASH . <