add support for docker layer caching and arm64/arm32v7 images (#81)

This commit is contained in:
Adam Kliś 2022-12-23 08:27:06 +01:00 committed by GitHub
parent 02e243a96e
commit 8664048ffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 1 deletions

View file

@ -26,6 +26,19 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
@ -43,4 +56,7 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}-dev:latest
ghcr.io/${{ github.repository }}-dev:${{ steps.gathervars.outputs.VERSION }}
platforms: linux/amd64,linux/arm64,linux/arm32v7
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true

View file

@ -23,7 +23,6 @@ jobs:
# setting tags
if echo "$VERSION" | grep -q "beta"; then
TAGS="ghcr.io/${{ github.repository }}:beta, ghcr.io/${{ github.repository }}:$VERSION, ghcr.io/${{ github.repository }}:latest"
PRIMARY_TAG=latest
else
@ -36,6 +35,19 @@ jobs:
$(docker manifest inspect ghcr.io/${{ github.repository }}:$VERSION > /dev/null) || NOT_PREVIOUSLY_PUBLISHED=1
echo "::set-output name=NOT_PREVIOUSLY_PUBLISHED::$NOT_PREVIOUSLY_PUBLISHED"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-
- name: Log in to the Container registry
uses: docker/login-action@v1
if: ${{ steps.gathervars.outputs.NOT_PREVIOUSLY_PUBLISHED != 0 }}
@ -54,6 +66,9 @@ jobs:
context: ./docker/production
tags: |
${{ steps.gathervars.outputs.TAG }}
platforms: linux/amd64,linux/arm64,linux/arm32v7
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true
- name: Extract build out of docker image