Skip to content

Commit

Permalink
Re-enable caching and change docker driver
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-milan authored and Guillaume De Saint Martin committed Mar 24, 2021
1 parent 3f5042a commit 4c531c2
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@master
with:
driver: docker
driver: docker-container
use: true

# - name: Cache Docker layers
# uses: actions/cache@v2
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: github.event_name == 'push'
Expand Down Expand Up @@ -109,15 +110,15 @@ jobs:
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm/v7
# Using "load: true" forces the docker driver.
# Not necessary here, because we set it before.
# ref: https://stackoverflow.com/a/64560710/9944075
# Unfortunately, the "docker" driver does not support
# multi-platform builds.
# load: true
push: false
tags: ${{ env.IMAGE }}:${{ env.LATEST }}
build-args: |
TENTACLES_URL_TAG=${{ env.LATEST }}
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Docker build test container
if: github.event_name != 'push'
Expand Down Expand Up @@ -155,8 +156,8 @@ jobs:
tags: ${{ env.IMAGE }}:${{ env.LATEST }}
build-args: |
TENTACLES_URL_TAG=${{ env.LATEST }}
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Build and push on tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
Expand All @@ -171,8 +172,8 @@ jobs:
${{ env.IMAGE }}:${{ env.LATEST }}
${{ env.IMAGE }}:${{ env.STABLE }}
${{ env.IMAGE }}:${{ env.VERSION }}
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

- name: Image digest
run: echo ${{ steps.docker_build_and_psuh.outputs.digest }}
Expand Down

0 comments on commit 4c531c2

Please sign in to comment.