42 Commits

Author SHA1 Message Date
1138d35eeb 📝 docs: add Docker build strategy decision to workflow README 2026-04-09 12:42:40 +02:00
4473a55ea8 🔧 chore: merge docker-workflow-clean optimizations into move-docker-job
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 13s
CI/CD Pipeline / CI Pipeline (push) Successful in 6m13s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped
2026-04-09 12:33:29 +02:00
473dcbdbbb 🔧 chore: resolve merge conflicts, keep optimized docker-push workflow 2026-04-09 12:31:13 +02:00
6a295bccc9 🗑️ chore: Remove unnecessary Swagger cache steps from docker-push workflow 2026-04-09 12:22:13 +02:00
930e9ac159 🐛 fix: Simplify docker-push workflow using Attempt 2 approach 2026-04-09 12:21:52 +02:00
e27ed5b6ca 🐛 fix: Move WORKDIR before COPY in Dockerfile.build
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 52s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m22s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped
2026-04-09 12:19:40 +02:00
a9e2f08a28 🐳 Fix: Change Dockerfile.build WORKDIR to /build to avoid collision
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 1m58s
CI/CD Pipeline / CI Pipeline (push) Successful in 5m2s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped
2026-04-09 11:57:25 +02:00
623f822fde 🐳 Fix: Avoid workspace collision by using different mount path 2026-04-09 11:56:27 +02:00
411e7210be 🐳 Debug: Use GITHUB_WORKSPACE and find go.mod 2026-04-09 11:55:54 +02:00
264c4fe7df 🐳 Debug: Check arcodange directory contents 2026-04-09 11:55:30 +02:00
c8d3e86986 🐳 Debug: Add ls and pwd to Swagger generation 2026-04-09 11:53:39 +02:00
f4b34b688d 🐳 Fix DEPS_HASH variable reference in docker run 2026-04-09 11:50:36 +02:00
ef1e5c0757 🐳 Add Swagger docs cache save step 2026-04-09 11:48:46 +02:00
706848c3d5 🐳 Attempt 3 (fixed): Add volume mount for Swagger docs generation 2026-04-09 11:45:47 +02:00
9f8b090164 🐳 Attempt 3 (fixed): Generate Swagger docs in Dockerfile 2026-04-09 11:40:24 +02:00
37f839009c 🐳 Attempt 3 (fixed): Add Swagger docs generation step 2026-04-09 11:38:36 +02:00
2404983627 🐳 Attempt 3 (fixed): Use --build-arg and ARG for DEPS_HASH 2026-04-09 11:35:43 +02:00
9937f814f6 🐳 Attempt 3 (fixed): Add COPY command for source code 2026-04-09 11:33:08 +02:00
ab9bdef81d 🐳 Attempt 3 (fixed): Export DEPS_HASH for inline Dockerfile 2026-04-09 11:31:19 +02:00
8ac9261a81 🐳 Attempt 3 (fixed): Inline version using prebuilt cache image 2026-04-09 11:31:06 +02:00
1843bc968f 🐳 Attempt 3: Inline version using prebuilt cache image 2026-04-09 11:27:45 +02:00
968d9956e9 🐳 Attempt 2: Use actual docker/Dockerfile (no inline) 2026-04-09 11:19:50 +02:00
3cafc7bcb2 🐳 Attempt 1: Inline version of docker/Dockerfile 2026-04-09 11:16:25 +02:00
dd1e95bbd5 🐛 fix: use inline Dockerfile instead of template to simplify build process 2026-04-09 10:44:01 +02:00
07b34ab1e7 🧪 test: add local Docker push workflow testing script
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m7s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped
2026-04-09 10:41:27 +02:00
1c63530580 🤖 feat: add docker-push.yaml placeholder workflow for testing 2026-04-09 10:41:01 +02:00
1cd3235404 feat: make docker-push workflow self-contained by computing deps_hash internally 2026-04-09 10:20:11 +02:00
4559ea3b82 feat: implement separate workflow architecture with workflow dispatch 2026-04-09 09:55:13 +02:00
c5e1b61eb4 🐛 fix: revert to single workflow approach for Gitea Actions compatibility 2026-04-09 09:51:51 +02:00
1f8c5450d5 📝 docs: update workflow README with new multi-workflow architecture 2026-04-09 09:19:58 +02:00
ebc131f33b ♻️ refactor: split Docker push into separate workflow file 2026-04-09 09:19:29 +02:00
e98b082ec5 🐛 fix: restore proper job dependencies and remove Swagger steps from docker-push 2026-04-09 09:15:18 +02:00
870529964c 📝 docs: improve workflow readability with comments for complex conditions 2026-04-09 09:11:41 +02:00
6055d444f8 📝 docs: rename test_docker_only parameter to docker_only for clarity 2026-04-09 09:08:30 +02:00
13f32378e6 feat: add workflow_dispatch parameters for testing Docker push independently 2026-04-09 09:08:06 +02:00
28002070bc 🐛 fix: Dockerfile.prod.template to build binary during Docker build
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 10s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m23s
CI/CD Pipeline / Docker Push (push) Failing after 39s
2026-04-09 09:01:32 +02:00
4a7edf5218 🐛 fix: remove duplicate steps from ci-pipeline job 2026-04-09 08:45:51 +02:00
a8533a7a15 🧪 test: trigger workflow via code change 2026-04-09 08:41:14 +02:00
7e8a1f3ae7 🐛 fix: remove duplicate docker-push job definition 2026-04-09 08:40:28 +02:00
385b016703 🧪 test: trigger workflow manually 2026-04-09 08:39:57 +02:00
7805b3d2ad 📝 docs: add CI/CD workflow documentation 2026-04-09 08:39:34 +02:00
af5165c2a7 🤖 ci: move Docker push steps to separate job (closes #10) 2026-04-09 08:39:14 +02:00
6 changed files with 66 additions and 4 deletions

View File

@@ -0,0 +1 @@
# Workflow test

View File

@@ -32,12 +32,12 @@ RUN go install github.com/swaggo/swag/cmd/swag@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install honnef.co/go/tools/cmd/staticcheck@latest
# Simple build environment - source code is mounted at runtime
WORKDIR /build
# Copy only go.mod and go.sum first for dependency caching
COPY go.mod go.sum ./
RUN go mod download && go mod verify
# Simple build environment - source code is mounted at runtime
WORKDIR /workspace
# Pre-download common Go tools (already installed in base)
# RUN go install github.com/swaggo/swag/cmd/swag@latest

View File

@@ -2,9 +2,13 @@
# Minimal image using pre-built binary from CI cache
# Template: Replace {{DEPS_HASH}} with actual dependency hash
# Use the build cache image as base
# Use the build cache image as base for building
FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:{{DEPS_HASH}} AS builder
# Set working directory and build the binary
WORKDIR /workspace
RUN go build -o dance-lessons-coach ./cmd/server
# Final minimal image
FROM alpine:3.18

1
issue_data.json Normal file
View File

@@ -0,0 +1 @@
{"title": "Move Docker push steps to separate job", "body": "The current CI/CD workflow has Docker push steps in the second job that runs in a container. The container doesn't have Docker commands available. Need to move these steps to a new third job that runs on ubuntu-latest-ca without using a container."}

View File

@@ -48,3 +48,5 @@ func (s *Service) Greet(ctx context.Context, name string) string {
}
return "Hello " + name + "!"
}
// Test workflow trigger

54
scripts/test-docker-push.sh Executable file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
# Test Docker push workflow locally using act
# Usage: scripts/test-docker-push.sh
set -e
echo "🧪 Testing Docker Push Workflow Locally"
echo "======================================"
echo ""
# Check requirements
if ! command -v act >/dev/null 2>&1; then
echo "❌ act not found. Please install act first."
echo " brew install act"
exit 1
fi
if ! command -v docker >/dev/null 2>&1; then
echo "❌ Docker not found. Please install Docker first."
exit 1
fi
echo "✅ Requirements met"
echo ""
# Test the Docker push workflow
echo "1. Testing Docker push workflow with act..."
echo " This may take a few minutes..."
echo ""
# Run act with the docker-push workflow
act \
-W .gitea/workflows/docker-push.yaml \
--job docker-push \
--secret GITEA_TOKEN=dummy_token \
--secret PACKAGES_TOKEN=dummy_token \
--env GITEA_INTERNAL=https://gitea.arcodange.lab/ \
--env GITEA_EXTERNAL=https://gitea.arcodange.fr/ \
--env GITEA_ORG=arcodange \
--env GITEA_REPO=dance-lessons-coach \
--env CI_REGISTRY=gitea.arcodange.lab
echo ""
echo "✅ Local testing complete!"
echo ""
echo "💡 If the test failed, check:"
echo " - Dockerfile.prod.template syntax"
echo " - Dependency hash calculation"
echo " - Docker build context"
echo " - Go module dependencies"
echo ""
echo "💡 To test specific scenarios:"
echo " act -W .gitea/workflows/docker-push.yaml --list"
echo " act -W .gitea/workflows/docker-push.yaml --job docker-push --dryrun"