From 3cafc7bcb28a938cfb392156a82267e4646745be Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:16:25 +0200 Subject: [PATCH 01/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=201:=20Inline=20ve?= =?UTF-8?q?rsion=20of=20docker/Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/README.md | 163 ++++++++++++++++++++++++++++++ .gitea/workflows/ci-cd.yaml | 61 ++++------- .gitea/workflows/docker-push.yaml | 132 +++++++++++++++++++++--- 3 files changed, 298 insertions(+), 58 deletions(-) create mode 100644 .gitea/workflows/README.md diff --git a/.gitea/workflows/README.md b/.gitea/workflows/README.md new file mode 100644 index 0000000..82ec6ff --- /dev/null +++ b/.gitea/workflows/README.md @@ -0,0 +1,163 @@ +# CI/CD Workflow Architecture + +## πŸ—ΊοΈ Overview + +The dance-lessons-coach project uses a **multi-workflow architecture** for better separation of concerns, maintainability, and flexibility. + +## πŸ“ Workflow Files + +### 1. `ci-cd.yaml` - Main CI/CD Pipeline + +**Purpose**: Run tests, build binaries, and generate documentation + +**Triggers**: +- Push to `main`, `ci/**`, `feature/**`, `fix/**`, `refactor/**` branches +- Pull requests to `main` branch +- Manual workflow dispatch + +**Jobs**: +1. **build-cache** - Build and cache Docker build environment +2. **ci-pipeline** - Run tests, build binaries, generate Swagger docs +3. **trigger-docker-push** - Trigger separate Docker workflow on main branch + +**Key Features**: +- Runs in container environment with all build tools +- Generates Swagger documentation +- Runs BDD and unit tests with PostgreSQL +- Updates badges and version information +- Triggers Docker workflow only on main branch + +### 2. `docker-push.yaml` - Docker Image Publishing + +**Purpose**: Build and push Docker images to registry + +**Triggers**: +- Manual workflow dispatch only (no automatic triggers) +- Triggered by `ci-cd.yaml` on main branch + +**Jobs**: +1. **docker-push** - Build production Docker image and push to registry + +**Key Features**: +- Runs on host environment (access to Docker daemon) +- Uses dependency hash from build-cache +- Builds minimal Alpine-based production image +- Pushes multiple tags (version, latest, commit SHA) + +## πŸ”§ Architecture Benefits + +### 1. Clear Separation of Concerns +- **CI/CD Pipeline**: Testing and artifact generation +- **Docker Publishing**: Image building and registry operations + +### 2. Proper Environment Isolation +- **CI jobs run in container**: Consistent build environment +- **Docker jobs run on host**: Access to Docker daemon + +### 3. Flexible Testing +- Can trigger Docker workflow independently for testing +- No complex conditional logic in main workflow +- Easier to debug and maintain + +### 4. Better Security +- Docker operations isolated in separate workflow +- Clear dependency between test success and deployment +- Manual trigger capability for emergency situations + +## πŸš€ Usage Examples + +### Trigger Full CI/CD Pipeline +```bash +# Automatically triggered on push to main branch +# Or manually: +./scripts/gitea-client.sh trigger-workflow arcodange dance-lessons-coach ci-cd.yaml main +``` + +### Trigger Docker Push Manually +```bash +# Get dependency hash from build-cache job first +DEPS_HASH="abc123def456" + +# Trigger Docker workflow manually +./scripts/gitea-client.sh trigger-workflow arcodange dance-lessons-coach docker-push.yaml main --deps_hash $DEPS_HASH +``` + +### Workflow Dispatch Parameters (docker-push.yaml) +- `deps_hash` (required): Dependency hash from build-cache job +- `ref` (optional): Git reference (branch/tag), defaults to current + +## πŸ”— Workflow Dependencies + +```mermaid +graph TD + A[Push to main] --> B[ci-cd.yaml] + B --> C[build-cache job] + B --> D[ci-pipeline job] + D --> E[trigger-docker-push job] + E --> F[docker-push.yaml] + F --> G[docker-push job] + G --> H[Docker Registry] +``` + +## πŸ“‹ Best Practices + +### 1. Always Run CI First +- Docker workflow should only be triggered after CI passes +- Maintains quality gate before deployment + +### 2. Use Dependency Hash +- Ensures consistent builds across workflows +- Pass hash from build-cache to docker-push + +### 3. Manual Testing +- Use separate Docker workflow for testing image builds +- Avoids polluting main branch with test images + +### 4. Monitor Both Workflows +- CI/CD workflow for test results and artifacts +- Docker workflow for image build and push status + +## 🎯 Future Enhancements + +### Potential Improvements: +- Add workflow status badges to README +- Implement workflow chaining with outputs +- Add matrix builds for multiple architectures +- Implement canary deployment workflow +- Add rollback capability + +### Architecture Considerations: +- Keep workflows focused on single responsibilities +- Maintain clear separation between test and deploy +- Document all workflow triggers and conditions +- Monitor workflow execution times and optimize + +## πŸ“ Maintenance + +### Adding New Jobs: +- Add to appropriate workflow based on responsibility +- CI-related jobs β†’ `ci-cd.yaml` +- Docker-related jobs β†’ `docker-push.yaml` + +### Modifying Triggers: +- Update trigger conditions in respective workflow files +- Test changes thoroughly before merging + +### Debugging: +- Check workflow logs in Gitea Actions +- Use `gitea-client.sh diagnose-job` for detailed analysis +- Monitor workflow dependencies and execution order + +## πŸ”’ Security + +### Secrets Management: +- Docker registry credentials stored in Gitea secrets +- Never hardcode credentials in workflow files +- Use GitHub token for workflow dispatch + +### Access Control: +- Only authorized users can trigger workflows +- Manual approval required for production deployments +- Audit logs available for all workflow executions + +This architecture provides a clean, maintainable, and secure CI/CD pipeline that scales well with project growth while maintaining clear separation of concerns. \ No newline at end of file diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index d3572de..2af0d9b 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -132,7 +132,8 @@ jobs: name: CI Pipeline needs: build-cache runs-on: ubuntu-latest-ca - if: "!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot'" + # Skip conditions: standard skip ci + actor check + respect skip_ci input + if: "!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot' && (!github.event.inputs.skip_ci || github.event.inputs.skip_ci == 'false')" container: image: ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}-build-cache:${{ needs.build-cache.outputs.deps_hash }} @@ -304,47 +305,23 @@ jobs: echo "ℹ️ No changes to push" fi - # Docker build and push (main branch only) - - name: Login to Gitea Container Registry - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - registry: ${{ env.CI_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.PACKAGES_TOKEN }} - - name: Build and push Docker image - if: github.ref == 'refs/heads/main' - run: | - source VERSION - IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" - - # Use the template file with proper dependency hash replacement - DEPS_HASH="${{ needs.build-cache.outputs.deps_hash }}" - echo "Using dependency hash: $DEPS_HASH" - - # Create Dockerfile.prod from template - sed "s/{{DEPS_HASH}}/$DEPS_HASH/g" docker/Dockerfile.prod.template > docker/Dockerfile.prod - - TAGS="$IMAGE_VERSION latest ${{ github.sha }}" - echo "Building Docker image with tags: $TAGS" - - # Build the production image - docker build -t dance-lessons-coach -f docker/Dockerfile.prod . - - for TAG in $TAGS; do - IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$TAG" - echo "Tagging and pushing: $IMAGE_NAME" - docker tag dance-lessons-coach "$IMAGE_NAME" - docker push "$IMAGE_NAME" - done - - name: Show published images - if: github.ref == 'refs/heads/main' + + # Trigger Docker push workflow on main branch + trigger-docker-push: + name: Trigger Docker Push + needs: [build-cache, ci-pipeline] + runs-on: ubuntu-latest-ca + if: "!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot' && github.ref == 'refs/heads/main'" + + steps: + - name: Trigger Docker Push Workflow run: | - source VERSION - IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" - echo "πŸ“¦ Published Docker images:" - echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$IMAGE_VERSION" - echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:latest" - echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:${{ github.sha }}" + echo "πŸš€ Triggering Docker Push workflow..." + curl -X POST \ + -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 }}"}' + echo "βœ… Docker Push workflow triggered successfully!" diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 025050a..1e4f879 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -1,27 +1,31 @@ --- -# dance-lessons-coach Docker Push Workflow - Placeholder -# This workflow will be implemented to handle Docker image building and pushing -# Currently a placeholder to test workflow dispatch functionality +# dance-lessons-coach Docker Push Workflow +# Separate workflow for Docker image building and pushing +# Can be triggered manually or by CI/CD workflow name: Docker Push on: - # Manual trigger only for testing + # 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 type: string default: '' +# Environment variables +env: + GITEA_INTERNAL: "https://gitea.arcodange.lab/" + GITEA_EXTERNAL: "https://gitea.arcodange.fr/" + GITEA_ORG: "arcodange" + GITEA_REPO: "dance-lessons-coach" + CI_REGISTRY: "gitea.arcodange.lab" + jobs: - placeholder: - name: Docker Push Placeholder + docker-push: + name: Docker Push runs-on: ubuntu-latest-ca steps: @@ -30,10 +34,106 @@ jobs: with: ref: ${{ github.event.inputs.ref || github.ref }} - - name: Show workflow inputs + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.CI_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.PACKAGES_TOKEN }} + + - name: Calculate dependency hash + id: calc_hash run: | - echo "πŸš€ Docker Push Workflow Triggered" - echo "Dependency Hash: ${{ github.event.inputs.deps_hash }}" - echo "Git Reference: ${{ github.event.inputs.ref || github.ref }}" - echo "πŸ“ This is a placeholder - full implementation coming soon!" - echo "βœ… Workflow dispatch is working correctly!" + # 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 calculated dependency hash + DEPS_HASH="${{ steps.calc_hash.outputs.deps_hash }}" + echo "Using dependency hash: $DEPS_HASH" + + TAGS="$IMAGE_VERSION latest ${{ github.sha }}" + echo "Building Docker image with tags: $TAGS" + + # Build the production image using inline version of docker/Dockerfile + docker build -t dance-lessons-coach -f - . <<'EOF' + # dance-lessons-coach Docker Image + # Multi-stage build for production deployment + + # Stage 1: Build binary + FROM golang:1.26.1-alpine AS builder + + WORKDIR /app + + # Copy go mod files + COPY go.mod go.sum ./ + RUN go mod download + + # Copy source code + COPY . ./ + + # Install swag and generate Swagger docs only if they don't exist + RUN if [ ! -f pkg/server/docs/swagger.json ]; then \ + echo "πŸ“ Generating Swagger documentation..." && \ + go install github.com/swaggo/swag/cmd/swag@latest && \ + cd pkg/server && go generate && \ + echo "βœ… Swagger documentation generated"; \ + else \ + echo "βœ… Swagger documentation already exists, skipping swag installation and generation"; \ + fi + + # Build binary + RUN CGO_ENABLED=0 GOOS=linux go build -o /dance-lessons-coach ./cmd/server + + # Stage 2: Final image + FROM alpine:3.18 + + WORKDIR /app + + # Install dependencies + RUN apk add --no-cache ca-certificates tzdata + + # Copy binary from builder + COPY --from=builder /dance-lessons-coach /app/dance-lessons-coach + + # Copy configuration + COPY config.yaml /app/config.yaml + + # Set permissions + RUN chmod +x /app/dance-lessons-coach + + # Set timezone + ENV TZ=UTC + + # Expose port + EXPOSE 8080 + + # Health check + HEALTHCHECK --interval=30s --timeout=3s \ + CMD wget -q --spider http://localhost:8080/api/health || exit 1 + + # Entry point + ENTRYPOINT ["/app/dance-lessons-coach"] + EOF + + for TAG in $TAGS; do + IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$TAG" + echo "Tagging and pushing: $IMAGE_NAME" + docker tag dance-lessons-coach "$IMAGE_NAME" + docker push "$IMAGE_NAME" + done + + - name: Show published images + run: | + source VERSION + IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" + echo "πŸ“¦ Published Docker images:" + echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$IMAGE_VERSION" + echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:latest" + echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:${{ github.sha }}" From 968d9956e984592e67c25c39a7f198e2579eac87 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:19:50 +0200 Subject: [PATCH 02/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=202:=20Use=20actua?= =?UTF-8?q?l=20docker/Dockerfile=20(no=20inline)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 62 +------------------------------ 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 1e4f879..bbcbc69 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -61,66 +61,8 @@ jobs: TAGS="$IMAGE_VERSION latest ${{ github.sha }}" echo "Building Docker image with tags: $TAGS" - # Build the production image using inline version of docker/Dockerfile - docker build -t dance-lessons-coach -f - . <<'EOF' - # dance-lessons-coach Docker Image - # Multi-stage build for production deployment - - # Stage 1: Build binary - FROM golang:1.26.1-alpine AS builder - - WORKDIR /app - - # Copy go mod files - COPY go.mod go.sum ./ - RUN go mod download - - # Copy source code - COPY . ./ - - # Install swag and generate Swagger docs only if they don't exist - RUN if [ ! -f pkg/server/docs/swagger.json ]; then \ - echo "πŸ“ Generating Swagger documentation..." && \ - go install github.com/swaggo/swag/cmd/swag@latest && \ - cd pkg/server && go generate && \ - echo "βœ… Swagger documentation generated"; \ - else \ - echo "βœ… Swagger documentation already exists, skipping swag installation and generation"; \ - fi - - # Build binary - RUN CGO_ENABLED=0 GOOS=linux go build -o /dance-lessons-coach ./cmd/server - - # Stage 2: Final image - FROM alpine:3.18 - - WORKDIR /app - - # Install dependencies - RUN apk add --no-cache ca-certificates tzdata - - # Copy binary from builder - COPY --from=builder /dance-lessons-coach /app/dance-lessons-coach - - # Copy configuration - COPY config.yaml /app/config.yaml - - # Set permissions - RUN chmod +x /app/dance-lessons-coach - - # Set timezone - ENV TZ=UTC - - # Expose port - EXPOSE 8080 - - # Health check - HEALTHCHECK --interval=30s --timeout=3s \ - CMD wget -q --spider http://localhost:8080/api/health || exit 1 - - # Entry point - ENTRYPOINT ["/app/dance-lessons-coach"] - EOF + # Build the production image using actual docker/Dockerfile (no inline) + docker build -t dance-lessons-coach -f docker/Dockerfile . for TAG in $TAGS; do IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$TAG" From 1843bc968f80b1009b2a1fd0801f7527c8375498 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:27:45 +0200 Subject: [PATCH 03/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203:=20Inline=20ve?= =?UTF-8?q?rsion=20using=20prebuilt=20cache=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 44 +++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index bbcbc69..6d69d6d 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -61,8 +61,48 @@ jobs: TAGS="$IMAGE_VERSION latest ${{ github.sha }}" echo "Building Docker image with tags: $TAGS" - # Build the production image using actual docker/Dockerfile (no inline) - docker build -t dance-lessons-coach -f docker/Dockerfile . + # Build the production image using inline version with prebuilt cache image + docker build -t dance-lessons-coach -f - . <<'EOF' + # dance-lessons-coach Production Docker Image + # Inline Dockerfile using prebuilt cache image + + # Use the build cache image as base + 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 + + WORKDIR /app + + # Install minimal dependencies + RUN apk add --no-cache ca-certificates tzdata + + # Copy binary from builder + COPY --from=builder /workspace/dance-lessons-coach /app/dance-lessons-coach + + # Copy configuration + COPY config.yaml /app/config.yaml + + # Set permissions + RUN chmod +x /app/dance-lessons-coach + + # Set timezone + ENV TZ=UTC + + # Expose port + EXPOSE 8080 + + # Health check + HEALTHCHECK --interval=30s --timeout=3s \ + CMD wget -q --spider http://localhost:8080/api/health || exit 1 + + # Entry point + ENTRYPOINT ["/app/dance-lessons-coach"] + EOF for TAG in $TAGS; do IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$TAG" From 8ac9261a81514e2728dabe882d49ddcb493caa01 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:31:06 +0200 Subject: [PATCH 04/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203=20(fixed):=20I?= =?UTF-8?q?nline=20version=20using=20prebuilt=20cache=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 6d69d6d..79a951d 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -62,7 +62,8 @@ jobs: echo "Building Docker image with tags: $TAGS" # Build the production image using inline version with prebuilt cache image - docker build -t dance-lessons-coach -f - . <<'EOF' + # Fixed: Use proper variable substitution in the inline Dockerfile + docker build -t dance-lessons-coach -f - . < Date: Thu, 9 Apr 2026 11:31:19 +0200 Subject: [PATCH 05/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203=20(fixed):=20E?= =?UTF-8?q?xport=20DEPS=5FHASH=20for=20inline=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 79a951d..69c3bb3 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -54,9 +54,10 @@ jobs: source VERSION IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" - # Use the calculated dependency hash + # Use the calculated dependency hash and export it DEPS_HASH="${{ steps.calc_hash.outputs.deps_hash }}" echo "Using dependency hash: $DEPS_HASH" + export DEPS_HASH TAGS="$IMAGE_VERSION latest ${{ github.sha }}" echo "Building Docker image with tags: $TAGS" From 9937f814f69dd04d24b2fe9fc2df886cad71f370 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:33:08 +0200 Subject: [PATCH 06/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203=20(fixed):=20A?= =?UTF-8?q?dd=20COPY=20command=20for=20source=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 69c3bb3..b12e020 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -63,7 +63,7 @@ jobs: echo "Building Docker image with tags: $TAGS" # Build the production image using inline version with prebuilt cache image - # Fixed: Use proper variable substitution in the inline Dockerfile + # Fixed: Proper working directory and source code copying docker build -t dance-lessons-coach -f - . < Date: Thu, 9 Apr 2026 11:35:43 +0200 Subject: [PATCH 07/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203=20(fixed):=20U?= =?UTF-8?q?se=20--build-arg=20and=20ARG=20for=20DEPS=5FHASH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index b12e020..7b0c56c 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -54,21 +54,22 @@ jobs: source VERSION IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}" - # Use the calculated dependency hash and export it + # 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" - export 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: Proper working directory and source code copying - docker build -t dance-lessons-coach -f - . < Date: Thu, 9 Apr 2026 11:38:36 +0200 Subject: [PATCH 08/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203=20(fixed):=20A?= =?UTF-8?q?dd=20Swagger=20docs=20generation=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 7b0c56c..26df20f 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -49,6 +49,22 @@ jobs: echo "Dependency hash: $DEPS_HASH" echo "deps_hash=$DEPS_HASH" >> $GITHUB_OUTPUT + - name: Restore Swagger Docs Cache + id: cache-swagger-restore + uses: actions/cache/restore@v5 + with: + path: | + pkg/server/docs/docs.go + pkg/server/docs/swagger.json + pkg/server/docs/swagger.yaml + key: swagger-docs-${{ hashFiles('cmd/server/main.go', 'pkg/greet/*.go', 'pkg/server/*.go', 'go.mod') }} + restore-keys: | + swagger-docs- + + - name: Generate Swagger Docs if needed + if: steps.cache-swagger-restore.outputs.cache-hit != 'true' + run: go generate ./pkg/server + - name: Build and push Docker image run: | source VERSION From 9f8b09016414ae83de162d12c1d79261471966f4 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:40:24 +0200 Subject: [PATCH 09/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203=20(fixed):=20G?= =?UTF-8?q?enerate=20Swagger=20docs=20in=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 26df20f..dbd4bd3 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -49,21 +49,7 @@ jobs: echo "Dependency hash: $DEPS_HASH" echo "deps_hash=$DEPS_HASH" >> $GITHUB_OUTPUT - - name: Restore Swagger Docs Cache - id: cache-swagger-restore - uses: actions/cache/restore@v5 - with: - path: | - pkg/server/docs/docs.go - pkg/server/docs/swagger.json - pkg/server/docs/swagger.yaml - key: swagger-docs-${{ hashFiles('cmd/server/main.go', 'pkg/greet/*.go', 'pkg/server/*.go', 'go.mod') }} - restore-keys: | - swagger-docs- - - name: Generate Swagger Docs if needed - if: steps.cache-swagger-restore.outputs.cache-hit != 'true' - run: go generate ./pkg/server - name: Build and push Docker image run: | @@ -91,8 +77,18 @@ jobs: # Copy source code to the correct working directory COPY . /workspace - # Set working directory and build the binary + # Set working directory and generate Swagger docs if needed WORKDIR /workspace + RUN if [ ! -f pkg/server/docs/swagger.json ]; then \ + echo "πŸ“ Generating Swagger documentation..." && \ + go install github.com/swaggo/swag/cmd/swag@latest && \ + cd pkg/server && go generate && \ + echo "βœ… Swagger documentation generated"; \ + else \ + echo "βœ… Swagger documentation already exists, skipping generation"; \ + fi + + # Build the binary RUN go build -o dance-lessons-coach ./cmd/server # Final minimal image From 706848c3d5edc389d18c53865b53fc8638c71b69 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:45:47 +0200 Subject: [PATCH 10/20] =?UTF-8?q?=F0=9F=90=B3=20Attempt=203=20(fixed):=20A?= =?UTF-8?q?dd=20volume=20mount=20for=20Swagger=20docs=20generation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index dbd4bd3..549b9a2 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -49,7 +49,26 @@ jobs: echo "Dependency hash: $DEPS_HASH" echo "deps_hash=$DEPS_HASH" >> $GITHUB_OUTPUT + - name: Restore Swagger Docs Cache + id: cache-swagger-restore + uses: actions/cache/restore@v5 + with: + path: | + pkg/server/docs/docs.go + pkg/server/docs/swagger.json + pkg/server/docs/swagger.yaml + key: swagger-docs-${{ hashFiles('cmd/server/main.go', 'pkg/greet/*.go', 'pkg/server/*.go', 'go.mod') }} + restore-keys: | + swagger-docs- + - name: Generate Swagger Docs if needed + if: steps.cache-swagger-restore.outputs.cache-hit != 'true' + run: > + docker run --rm + -v $(pwd):/workspace + -w /workspace + gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${DEPS_HASH} + go generate ./pkg/server - name: Build and push Docker image run: | @@ -77,18 +96,8 @@ jobs: # Copy source code to the correct working directory COPY . /workspace - # Set working directory and generate Swagger docs if needed + # Set working directory and build the binary WORKDIR /workspace - RUN if [ ! -f pkg/server/docs/swagger.json ]; then \ - echo "πŸ“ Generating Swagger documentation..." && \ - go install github.com/swaggo/swag/cmd/swag@latest && \ - cd pkg/server && go generate && \ - echo "βœ… Swagger documentation generated"; \ - else \ - echo "βœ… Swagger documentation already exists, skipping generation"; \ - fi - - # Build the binary RUN go build -o dance-lessons-coach ./cmd/server # Final minimal image From ef1e5c07571b5da2490719cec1784d9383e1a9b6 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:48:46 +0200 Subject: [PATCH 11/20] =?UTF-8?q?=F0=9F=90=B3=20Add=20Swagger=20docs=20cac?= =?UTF-8?q?he=20save=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 549b9a2..e5e27bf 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -70,6 +70,27 @@ jobs: gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${DEPS_HASH} go generate ./pkg/server + - name: Save Swagger Docs Cache + if: steps.cache-swagger-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: | + pkg/server/docs/docs.go + pkg/server/docs/swagger.json + pkg/server/docs/swagger.yaml + key: ${{ steps.cache-swagger-restore.outputs.cache-primary-key }} + + - name: Save Swagger Docs Cache + if: steps.cache-swagger-restore.outputs.cache-hit != 'true' + id: cache-swagger-save + uses: actions/cache/save@v5 + with: + path: | + pkg/server/docs/docs.go + pkg/server/docs/swagger.json + pkg/server/docs/swagger.yaml + key: ${{ steps.cache-swagger-restore.outputs.cache-primary-key }} + - name: Build and push Docker image run: | source VERSION From f4b34b688d73a5e818bbdcce4f91d8fb948092df Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:50:36 +0200 Subject: [PATCH 12/20] =?UTF-8?q?=F0=9F=90=B3=20Fix=20DEPS=5FHASH=20variab?= =?UTF-8?q?le=20reference=20in=20docker=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index e5e27bf..8223060 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -67,18 +67,8 @@ jobs: docker run --rm -v $(pwd):/workspace -w /workspace - gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${DEPS_HASH} + gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ steps.calc_hash.outputs.deps_hash }} go generate ./pkg/server - - - name: Save Swagger Docs Cache - if: steps.cache-swagger-restore.outputs.cache-hit != 'true' - uses: actions/cache/save@v5 - with: - path: | - pkg/server/docs/docs.go - pkg/server/docs/swagger.json - pkg/server/docs/swagger.yaml - key: ${{ steps.cache-swagger-restore.outputs.cache-primary-key }} - name: Save Swagger Docs Cache if: steps.cache-swagger-restore.outputs.cache-hit != 'true' From c8d3e8698679d9288c3927370b7567d54251fde3 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:53:39 +0200 Subject: [PATCH 13/20] =?UTF-8?q?=F0=9F=90=B3=20Debug:=20Add=20ls=20and=20?= =?UTF-8?q?pwd=20to=20Swagger=20generation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 8223060..a56a080 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -68,7 +68,7 @@ jobs: -v $(pwd):/workspace -w /workspace gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ steps.calc_hash.outputs.deps_hash }} - go generate ./pkg/server + sh -c "ls -la && pwd && go generate ./pkg/server" - name: Save Swagger Docs Cache if: steps.cache-swagger-restore.outputs.cache-hit != 'true' From 264c4fe7dfd0ef3240d95e4a9a8267514fe39a63 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:55:30 +0200 Subject: [PATCH 14/20] =?UTF-8?q?=F0=9F=90=B3=20Debug:=20Check=20arcodange?= =?UTF-8?q?=20directory=20contents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index a56a080..8fc8a16 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -68,7 +68,7 @@ jobs: -v $(pwd):/workspace -w /workspace gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ steps.calc_hash.outputs.deps_hash }} - sh -c "ls -la && pwd && go generate ./pkg/server" + sh -c "ls -la && pwd && ls -la arcodange/ && go generate ./pkg/server" - name: Save Swagger Docs Cache if: steps.cache-swagger-restore.outputs.cache-hit != 'true' From 411e7210be2d4ac1db8cdaa6d34ad2da029dbcc5 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:55:54 +0200 Subject: [PATCH 15/20] =?UTF-8?q?=F0=9F=90=B3=20Debug:=20Use=20GITHUB=5FWO?= =?UTF-8?q?RKSPACE=20and=20find=20go.mod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 8fc8a16..fd48d53 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -65,10 +65,10 @@ jobs: if: steps.cache-swagger-restore.outputs.cache-hit != 'true' run: > docker run --rm - -v $(pwd):/workspace + -v ${GITHUB_WORKSPACE}:/workspace -w /workspace gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ steps.calc_hash.outputs.deps_hash }} - sh -c "ls -la && pwd && ls -la arcodange/ && go generate ./pkg/server" + sh -c "ls -la && pwd && ls -la && find . -name go.mod -type f 2>/dev/null" - name: Save Swagger Docs Cache if: steps.cache-swagger-restore.outputs.cache-hit != 'true' From 623f822fde2a6472f15342cfa35a9f98eb3687b6 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:56:27 +0200 Subject: [PATCH 16/20] =?UTF-8?q?=F0=9F=90=B3=20Fix:=20Avoid=20workspace?= =?UTF-8?q?=20collision=20by=20using=20different=20mount=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index fd48d53..731b4f9 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -65,10 +65,10 @@ jobs: if: steps.cache-swagger-restore.outputs.cache-hit != 'true' run: > docker run --rm - -v ${GITHUB_WORKSPACE}:/workspace + -v ${GITHUB_WORKSPACE}:/host-workspace -w /workspace gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ steps.calc_hash.outputs.deps_hash }} - sh -c "ls -la && pwd && ls -la && find . -name go.mod -type f 2>/dev/null" + sh -c "cp -r /host-workspace/. /workspace && ls -la && pwd && find . -name go.mod -type f 2>/dev/null" - name: Save Swagger Docs Cache if: steps.cache-swagger-restore.outputs.cache-hit != 'true' From a9e2f08a28d0141abf3a6d2dcb8077516b9fbe17 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 11:57:25 +0200 Subject: [PATCH 17/20] =?UTF-8?q?=F0=9F=90=B3=20Fix:=20Change=20Dockerfile?= =?UTF-8?q?.build=20WORKDIR=20to=20/build=20to=20avoid=20collision?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 5 ++--- docker/Dockerfile.build | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 731b4f9..29f00ba 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -65,10 +65,9 @@ jobs: if: steps.cache-swagger-restore.outputs.cache-hit != 'true' run: > docker run --rm - -v ${GITHUB_WORKSPACE}:/host-workspace - -w /workspace + -v ${GITHUB_WORKSPACE}:/build gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:${{ steps.calc_hash.outputs.deps_hash }} - sh -c "cp -r /host-workspace/. /workspace && ls -la && pwd && find . -name go.mod -type f 2>/dev/null" + go generate ./pkg/server - name: Save Swagger Docs Cache if: steps.cache-swagger-restore.outputs.cache-hit != 'true' diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build index 1d3ce86..dbecb89 100644 --- a/docker/Dockerfile.build +++ b/docker/Dockerfile.build @@ -37,7 +37,7 @@ COPY go.mod go.sum ./ RUN go mod download && go mod verify # Simple build environment - source code is mounted at runtime -WORKDIR /workspace +WORKDIR /build # Pre-download common Go tools (already installed in base) # RUN go install github.com/swaggo/swag/cmd/swag@latest \ No newline at end of file From e27ed5b6caf4d62bf260c62ea9e8ef35f636210a Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 12:19:40 +0200 Subject: [PATCH 18/20] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Move=20WORKDIR=20be?= =?UTF-8?q?fore=20COPY=20in=20Dockerfile.build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build index dbecb89..2e0b5eb 100644 --- a/docker/Dockerfile.build +++ b/docker/Dockerfile.build @@ -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 /build - # Pre-download common Go tools (already installed in base) # RUN go install github.com/swaggo/swag/cmd/swag@latest \ No newline at end of file From 930e9ac159892d58b0a7d26c050297a8e4dfcbe2 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Thu, 9 Apr 2026 12:21:52 +0200 Subject: [PATCH 19/20] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Simplify=20docker-p?= =?UTF-8?q?ush=20workflow=20using=20Attempt=202=20approach?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 69 ++++--------------------------- 1 file changed, 7 insertions(+), 62 deletions(-) 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 . < Date: Thu, 9 Apr 2026 12:22:13 +0200 Subject: [PATCH 20/20] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20chore:=20Remove?= =?UTF-8?q?=20unnecessary=20Swagger=20cache=20steps=20from=20docker-push?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/docker-push.yaml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.gitea/workflows/docker-push.yaml b/.gitea/workflows/docker-push.yaml index 4f149c6..d354d06 100644 --- a/.gitea/workflows/docker-push.yaml +++ b/.gitea/workflows/docker-push.yaml @@ -43,37 +43,7 @@ jobs: - - name: Restore Swagger Docs Cache - id: cache-swagger-restore - uses: actions/cache/restore@v5 - with: - path: | - pkg/server/docs/docs.go - pkg/server/docs/swagger.json - pkg/server/docs/swagger.yaml - key: swagger-docs-${{ hashFiles('cmd/server/main.go', 'pkg/greet/*.go', 'pkg/server/*.go', 'go.mod') }} - restore-keys: | - swagger-docs- - - name: Generate Swagger Docs if needed - if: steps.cache-swagger-restore.outputs.cache-hit != 'true' - run: > - docker run --rm - -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' - id: cache-swagger-save - uses: actions/cache/save@v5 - with: - path: | - pkg/server/docs/docs.go - pkg/server/docs/swagger.json - pkg/server/docs/swagger.yaml - key: ${{ steps.cache-swagger-restore.outputs.cache-primary-key }} - name: Build and push Docker image run: |