Skip to content

Commit

Permalink
Cache image to speed up building process
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciechos committed Aug 10, 2023
1 parent 741940c commit f2ff245
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/docker-image-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Docker Buildx with Container Driver
run: docker buildx create --use --driver=docker-container

- name: Login to Docker Hub
uses: docker/login-action@v2
Expand All @@ -41,6 +41,8 @@ jobs:
platforms: 'linux/amd64'
push: true
tags: nethermindeth/juno:${{ github.event.inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max

build_and_push_docker_image_arm:
if: github.repository_owner == 'NethermindEth'
Expand All @@ -51,9 +53,9 @@ jobs:
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up Docker Buildx with Container Driver
run: docker buildx create --use --driver=docker-container

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -67,11 +69,13 @@ jobs:
platforms: 'linux/arm64'
push: true
tags: nethermindeth/juno:${{ github.event.inputs.tag }}-arm64

cache-from: type=gha
cache-to: type=gha,mode=max

- name: Cleanup self-hosted
run: |
docker system prune -af
create_and_push_official_image:
if: github.repository_owner == 'NethermindEth' && github.event.inputs.repo_type == 'official'
needs: [build_and_push_docker_image_amd, build_and_push_docker_image_arm]
Expand Down

0 comments on commit f2ff245

Please sign in to comment.