diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-12 09:20:19 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-12 09:20:19 -0500 |
| commit | 55c95dbd7316d25852e0a36322924fa673af9074 (patch) | |
| tree | fb225f9bdde2fa33e49f1412b494cd918e7c0219 /.github | |
| parent | a549585dc52e480bec7eaf736bd570cea5380cb4 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 20 | ||||
| -rw-r--r-- | .github/workflows/docker.yml | 4 |
2 files changed, 10 insertions, 14 deletions
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 |
