From 8e30e571ff4267ec1d65ee7390711701159c7334 Mon Sep 17 00:00:00 2001 From: Dan Erickson Date: Fri, 18 Mar 2022 02:01:17 -0400 Subject: [PATCH] CICD use GHCR cache instead of GHA cache for builds Apparently the GHA cache has a size limit of 10GB, so hopefully just using the existing images as cache instead will fix the issue. --- .github/workflows/publish-dev.yml | 10 +++------- .github/workflows/publish.yml | 11 +++-------- .github/workflows/testing.yml | 10 +++------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 879f871..e062b7e 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -22,11 +22,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Force update docker layer caching - run: | - docker pull ghcr.io/derickson2402/dockerized-caen:latest - docker pull ghcr.io/derickson2402/dockerized-caen:dev - - name: Docker metadata id: meta uses: docker/metadata-action@v3 @@ -48,8 +43,9 @@ jobs: uses: docker/build-push-action@v2 with: context: . - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=ghcr.io/derickson2402/dockerized-caen:buildcache + cache-to: type=registry,ref=ghcr.io/derickson2402/dockerized-caen:buildcache,mode=max + pull: true push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b887eba..50f3f18 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,11 +22,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Force update docker layer caching - run: | - docker pull ghcr.io/derickson2402/dockerized-caen:latest - docker pull ghcr.io/derickson2402/dockerized-caen:dev - - name: Docker metadata id: meta uses: docker/metadata-action@v3 @@ -51,9 +46,9 @@ jobs: uses: docker/build-push-action@v2 with: context: . - push: true + cache-from: type=registry,ref=ghcr.io/derickson2402/dockerized-caen:buildcache + cache-to: type=registry,ref=ghcr.io/derickson2402/dockerized-caen:buildcache,mode=max pull: true - cache-from: type=gha - cache-to: type=gha,mode=max + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 4825fad..8c31bcd 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -25,17 +25,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Force update docker layer caching - run: | - docker pull ghcr.io/derickson2402/dockerized-caen:latest - docker pull ghcr.io/derickson2402/dockerized-caen:dev - - name: Build for testing uses: docker/build-push-action@v2 with: context: . - cache-from: type=gha - load: true + cache-from: type=registry,ref=ghcr.io/derickson2402/dockerized-caen:buildcache + cache-to: type=registry,ref=ghcr.io/derickson2402/dockerized-caen:buildcache,mode=max + pull: true push: false tags: ${{ env.TEST_TAG }}