Skip to content

Commit

Permalink
CICD use GHCR cache instead of GHA cache for builds
Browse files Browse the repository at this point in the history
Apparently the GHA cache has a size limit of 10GB, so hopefully just using the existing images as cache instead will fix the issue.
  • Loading branch information
Dan Erickson committed Mar 18, 2022
1 parent 399a55f commit 8e30e57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
11 changes: 3 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
10 changes: 3 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down

0 comments on commit 8e30e57

Please sign in to comment.