From cd13f1478aefd33754b79fc16e95b8aaae968a9d Mon Sep 17 00:00:00 2001 From: George Wilkinson Date: Fri, 7 Nov 2025 12:15:13 +0000 Subject: [PATCH] Update .gitea/workflows/ci.yml --- .gitea/workflows/ci.yml | 64 ++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 15f94f3..583873b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,10 +10,10 @@ env: IMAGE_NAME: tonehaus DOCKERFILE: docker/php/Dockerfile BUILD_TARGET: prod - PLATFORMS: linux/amd64,linux/arm64 + PLATFORMS: linux/amd64 jobs: - build: + tonehaus-ci-build: runs-on: ubuntu-latest steps: - name: Checkout @@ -38,28 +38,46 @@ jobs: run: | echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" -u "$REGISTRY_USERNAME" --password-stdin - - name: Build single-arch images for artifacts (no registry) - if: ${{ env.REGISTRY == '' }} + - name: Docker Build + if: ${{ env.REGISTRY != '' && env.REGISTRY_IMAGE != '' }} + env: + REGISTRY: ${{ secrets.REGISTRY }} + REGISTRY_IMAGE: ${{ secrets.REGISTRY_IMAGE }} run: | TAG_SHA=${{ steps.meta.outputs.short_sha }} - for P in linux/amd64; do \ - ARCH=${P#linux/}; \ - docker buildx build \ - --platform "$P" \ - --file "$DOCKERFILE" \ - --target "$BUILD_TARGET" \ - --build-arg APP_ENV=prod \ - --output type=docker \ - --tag "$IMAGE_NAME:$TAG_SHA-$ARCH" \ - . ; \ - docker save "$IMAGE_NAME:$TAG_SHA-$ARCH" -o "tonehaus-image-$ARCH.tar" ; \ - done + docker buildx build \ + --platform "$PLATFORMS" \ + --file "$DOCKERFILE" \ + --target "$BUILD_TARGET" \ + --build-arg APP_ENV=prod \ + --tag "$REGISTRY/$REGISTRY_IMAGE:$TAG_SHA" \ + --tag "$REGISTRY/$REGISTRY_IMAGE:ci" \ + --push \ + . - - name: Upload artifacts - if: ${{ env.REGISTRY == '' }} - uses: actions/upload-artifact@v4 - with: - name: tonehaus-images - path: | - tonehaus-image-amd64.tar + # - name: Build single-arch images for artifacts (no registry) + # if: ${{ env.REGISTRY == '' }} + # run: | + # TAG_SHA=${{ steps.meta.outputs.short_sha }} + # for P in $PLATFORMS; do \ + # ARCH=${P#linux/}; \ + # docker buildx build \ + # --platform "$P" \ + # --file "$DOCKERFILE" \ + # --target "$BUILD_TARGET" \ + # --build-arg APP_ENV=prod \ + # --output type=docker \ + # --tag "$IMAGE_NAME:$TAG_SHA-$ARCH" \ + # . ; \ + # docker save "$IMAGE_NAME:$TAG_SHA-$ARCH" -o "tonehaus-image-$ARCH.tar" ; \ + # done + +## Artifacts not configured yet.. +# - name: Upload artifacts +# if: ${{ env.REGISTRY == '' }} +# uses: actions/upload-artifact@v4 +# with: +# name: tonehaus-images +# path: | +# tonehaus-image-amd64.tar