From fb26361f853f2f0abef4dd307c65c2d10bada4e0 Mon Sep 17 00:00:00 2001 From: Daniel Arroyo Date: Wed, 12 Aug 2026 19:04:48 -0400 Subject: [PATCH] fix(ci): merge build-native and docker into one job to avoid 117MB artifact upload The runner (runner-lxc-quarkus, using act) fails to upload the 117MB native binary via actions/upload-artifact@v4 with exit code 1 after 3 minutes. Avoid the artifact transfer entirely by collapsing build-native and docker-native into a single job: build native binary, then build the Docker image directly from the working tree in the same container. The container has the binary at target/shot-crafter-calculator-1.0.0-runner and the Dockerfile expects it at the same path, so the build chain works without any artifact download/upload. Push only happens on push to main (not on PRs). --- .gitea/workflows/ci.yml | 65 +++++++++++------------------------------ 1 file changed, 17 insertions(+), 48 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0021783..ca19d46 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -63,52 +63,21 @@ jobs: - name: Verify native binary run: | - ls -la target/ - file target/shot-crafter-calculator-1.0.0-runner 2>/dev/null || echo "binary not found" + ls -la target/shot-crafter-calculator-1.0.0-runner - - name: Upload Native binary - uses: actions/upload-artifact@v4 - with: - name: shot-crafter-calculator-runner - path: target/shot-crafter-calculator-1.0.0-runner - if-no-files-found: error - - docker-native: - name: Build & Push Native Image - runs-on: ubuntu-latest - needs: build-native - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download native binary - uses: actions/download-artifact@v4 - with: - name: shot-crafter-calculator-runner - path: target/ - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Gitea Container Registry - uses: docker/login-action@v3 - with: - registry: gitea.danielarroyo.cl - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_TOKEN }} - - - name: Extract short SHA - id: meta - run: echo "short_sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile - push: true - tags: | - gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:latest - gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:${{ steps.meta.outputs.short_sha }} - platforms: linux/amd64 + - name: Build & Push Docker image + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + set -e + echo "=== Build Docker image ===" + docker build -t shot-crafter-calculator:ci . + echo "=== Login to Gitea Registry ===" + echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.danielarroyo.cl -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin + echo "=== Tag ===" + docker tag shot-crafter-calculator:ci gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:latest + docker tag shot-crafter-calculator:ci gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:${GITHUB_SHA::7} + echo "=== Push ===" + docker push gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:latest + docker push gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:${GITHUB_SHA::7} + echo "=== Logout ===" + docker logout gitea.danielarroyo.cl