From fe657fd79d5e8e33b22eb8c3cc800a1b2cf9c006 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 17 Aug 2026 13:31:42 +0200 Subject: [PATCH] ci: reuse amd64 preview image for e2e instead of rebuilding The container (e2e) job now depends on the amd64 preview job and pulls the pushed digest, retagging it as homarr-e2e, so the image is compiled once. Falls back to a local build for forks and merge queues where the preview job does not run. --- .github/workflows/ci.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23992359b..b806ef201 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,16 +105,20 @@ jobs: container: name: Container and E2E - needs: fast-gate + needs: [fast-gate, preview-amd64] if: | - github.event_name == 'merge_group' || - (github.event_name == 'push' && github.ref == 'refs/heads/release/v2') || - (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || - (github.event_name == 'workflow_dispatch' && (inputs.operation == 'validate' || inputs.operation == 'publish')) + always() && + ( + github.event_name == 'merge_group' || + (github.event_name == 'push' && github.ref == 'refs/heads/release/v2') || + (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || + (github.event_name == 'workflow_dispatch' && (inputs.operation == 'validate' || inputs.operation == 'publish')) + ) runs-on: ubuntu-latest timeout-minutes: 30 permissions: contents: read + packages: read steps: - uses: actions/checkout@v7 if: "!env.ACT" @@ -129,8 +133,18 @@ jobs: if: "!env.ACT" uses: docker/setup-buildx-action@v4 + - name: Reuse amd64 preview image + if: needs.preview-amd64.outputs.digest != '' && !env.ACT + env: + DIGEST: ${{ needs.preview-amd64.outputs.digest }} + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin + docker pull "${PREVIEW_IMAGE}@${DIGEST}" + docker tag "${PREVIEW_IMAGE}@${DIGEST}" homarr-ci + docker tag "${PREVIEW_IMAGE}@${DIGEST}" homarr-e2e + - name: Build container once - if: "!env.ACT" + if: needs.preview-amd64.outputs.digest == '' && !env.ACT uses: docker/build-push-action@v7 with: context: .