Skip to content

ci: Cache layers in Docker build #10

ci: Cache layers in Docker build

ci: Cache layers in Docker build #10

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
packages: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: docker/setup-buildx-action@v3 # for cross-arch build - GH runners are AMD but VPS is ARM
- name: Set release version
# `#v` to strip the `v` prefix: v1.2.3 -> 1.2.3
run: echo "RELEASE_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Log in to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image and publish to GHCR
uses: docker/[email protected]
with:
context: .
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/arm64
# Disable provenance to prevent multi-platform index with unused layers like `unknown/unknown`
# https://github.com/docker/buildx/issues/1509#issuecomment-1378538197
provenance: false
tags: |
ghcr.io/ivov/n8n-shortlink:latest
ghcr.io/ivov/n8n-shortlink:${{ env.RELEASE_VERSION }}