From 55c95dbd7316d25852e0a36322924fa673af9074 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Thu, 12 Mar 2026 09:20:19 -0500 Subject: Fix CI: pull pre-built Docker image instead of rebuilding every run ci.yml was rebuilding the Docker image from scratch on every push because it used a different cache backend (registry) than docker.yml (gha). Now CI pulls the pre-built image from GHCR directly, and docker.yml uses consistent registry caching. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 20 ++++++++------------ .github/workflows/docker.yml | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d452767..2ce5cc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Log in to GHCR uses: docker/login-action@v3 with: @@ -32,15 +29,14 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - context: docker - file: docker/Dockerfile - load: true - tags: fluorine-builder:latest - cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max + - name: Pull or build Docker image + run: | + if docker pull ${{ env.IMAGE_NAME }}:latest; then + docker tag ${{ env.IMAGE_NAME }}:latest fluorine-builder:latest + else + echo "Pull failed, building from scratch..." + docker build -t fluorine-builder:latest docker/ + fi - name: Restore ccache uses: actions/cache@v4 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c9c0889..ce6f4da 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -41,5 +41,5 @@ jobs: tags: | ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max -- cgit v1.3.1