Skip to content

Commit

Permalink
GitHub cache workaround (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
oittaa authored Mar 12, 2021
1 parent d6fd019 commit e51b8f1
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:

docker:
runs-on: ubuntu-20.04
strategy:
matrix:
arch: [linux/amd64, linux/arm64]
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
Expand All @@ -59,27 +62,26 @@ jobs:
uses: actions/[email protected]
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-build-x-${{ github.sha }}
key: ${{ runner.os }}-build-x-${{ matrix.arch }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-x-
- name: Build AMD64
${{ runner.os }}-build-x-${{ matrix.arch }}-
- name: Build
uses: docker/build-push-action@v2
with:
platforms: linux/amd64
platforms: ${{ matrix.arch }}
push: false
load: true
tags: oittaa/gcp-storage-emulator:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build ARM64
uses: docker/build-push-action@v2
with:
platforms: linux/arm64
push: false
load: false
tags: oittaa/gcp-storage-emulator:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
-
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Docker container up
run: docker run -d --rm -p 8080:8080 --name gcp-storage-emulator oittaa/gcp-storage-emulator
- name: Wait 10 seconds
Expand Down

0 comments on commit e51b8f1

Please sign in to comment.