fix(ci): merge build-native and docker into one job to avoid 117MB artifact upload
CI / Build Native (push) Failing after 11m27s

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).
This commit is contained in:
2026-08-12 19:04:48 -04:00
parent 08c0686aae
commit fb26361f85
+17 -48
View File
@@ -63,52 +63,21 @@ jobs:
- name: Verify native binary - name: Verify native binary
run: | run: |
ls -la target/ ls -la target/shot-crafter-calculator-1.0.0-runner
file target/shot-crafter-calculator-1.0.0-runner 2>/dev/null || echo "binary not found"
- name: Upload Native binary - name: Build & Push Docker image
uses: actions/upload-artifact@v4 if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with: run: |
name: shot-crafter-calculator-runner set -e
path: target/shot-crafter-calculator-1.0.0-runner echo "=== Build Docker image ==="
if-no-files-found: error docker build -t shot-crafter-calculator:ci .
echo "=== Login to Gitea Registry ==="
docker-native: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.danielarroyo.cl -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
name: Build & Push Native Image echo "=== Tag ==="
runs-on: ubuntu-latest docker tag shot-crafter-calculator:ci gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:latest
needs: build-native docker tag shot-crafter-calculator:ci gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:${GITHUB_SHA::7}
if: github.event_name == 'push' && github.ref == 'refs/heads/main' echo "=== Push ==="
steps: docker push gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:latest
- name: Checkout docker push gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:${GITHUB_SHA::7}
uses: actions/checkout@v4 echo "=== Logout ==="
docker logout gitea.danielarroyo.cl
- 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