From cd6c11b9c7c62cc18cedef2dc86b16632f033a36 Mon Sep 17 00:00:00 2001 From: Daniel Sy Date: Tue, 29 Apr 2025 07:50:19 +0200 Subject: [PATCH] fix(#3): :loud_sound: debug failing docker build --- .forgejo/workflows/pipeline.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/pipeline.yml b/.forgejo/workflows/pipeline.yml index 07e5933..cbbdec6 100644 --- a/.forgejo/workflows/pipeline.yml +++ b/.forgejo/workflows/pipeline.yml @@ -14,12 +14,25 @@ jobs: go-version: '1.24' - name: Build Go Binary run: go mod tidy && go build -o loic + - name: Test Go Binary + run: go test + - name: Debug Variables + run: | + env + echo "Commit SHA: $GITHUB_SHA" + echo "Identity: {{ .Identity }}" + echo "Forgejo Base URL: $FORGEJO_BASE_URL" - name: Build and Push Docker Image run: | - docker build -t loic:${{ github.sha }} . - docker tag loic:${{ github.sha }} ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }} - docker login -u {{ .Identity }} --password-stdin ${{ secret.PASSWORD }} - docker push ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }} + echo "Building Docker image..." + docker build -t loic:${{ github.sha }} . || { echo "Docker build failed"; exit 1; } + echo "Tagging image..." + docker tag loic:${{ github.sha }} ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }} || { echo "Docker tag failed"; exit 1; } + echo "Logging in to Forgejo registry..." + docker login -u {{ .Identity }} --password-stdin ${{ secret.PASSWORD }} || { echo "Docker login failed"; exit 1; } + echo "Pushing Docker image..." + docker push ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }} || { echo "Docker push failed"; exit 1; } + echo "Done!" # - name: Update Deployment Manifest # run: |