This commit is contained in:
Elio Bischof
2025-06-17 21:23:15 +02:00
parent 5ef600e181
commit c359a31172
3 changed files with 22 additions and 36 deletions

View File

@@ -10,19 +10,13 @@ jobs:
contents: "read" contents: "read"
packages: "write" packages: "write"
steps: steps:
- uses: actions/checkout@v4 - name: Login to GitHub Container Registry
- name: Set up Docker uses: docker/login-action@v3
# We enable the containerd image store, so the buildx driver of type docker can cache-export build layers.
# The driver docker-container has many cache misses, as it stores its state in an ephemeral docker volume.
# This state is only populated after the first build, but the docker build layer cache depends on it.
uses: docker/setup-docker-action@v4
with: with:
daemon-config: | registry: ghcr.io
{ username: ${{ github.actor }}
"features": { password: ${{ secrets.GITHUB_TOKEN }}
"containerd-snapshotter": true - uses: actions/checkout@v4
}
}
- name: Docker meta - name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
@@ -35,17 +29,9 @@ jobs:
type=semver,pattern={{version}} type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}} type=semver,pattern={{major}}
- name: Set up persistent Buildx builder - name: Set up Buildx docker-container builder
id: buildx id: buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build - name: Build
uses: docker/bake-action@v6 uses: docker/bake-action@v6
env: env:

View File

@@ -4,25 +4,25 @@ target "login-pnpm" {
cache-to = [ cache-to = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}", "mode": "max" }
] ]
output = [ # output = [
{ "type" : "image", "name": "${IMAGE_REGISTRY}/login-pnpm:${BUILD_CACHE_KEY}", push: true }, # { "type" : "image", "name": "${IMAGE_REGISTRY}/login-pnpm:${BUILD_CACHE_KEY}", push: true },
] # ]
} }
target "login-dev-base" { target "login-dev-base" {
cache-to = [ cache-to = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}", "mode": "max" }
] ]
output = [ # output = [
{ "type" : "image", "name": "${IMAGE_REGISTRY}/login-dev-base:${BUILD_CACHE_KEY}", push: true }, # { "type" : "image", "name": "${IMAGE_REGISTRY}/login-dev-base:${BUILD_CACHE_KEY}", push: true },
] # ]
} }
target "login-lint" { target "login-lint" {
cache-to = [ cache-to = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}", "mode": "max" }
] ]
output = [ # output = [
{ "type" : "image", "name": "${IMAGE_REGISTRY}/login-lint:${BUILD_CACHE_KEY}", push: true }, # { "type" : "image", "name": "${IMAGE_REGISTRY}/login-lint:${BUILD_CACHE_KEY}", push: true },
] # ]
} }

View File

@@ -10,16 +10,16 @@ variable "BUILD_CACHE_KEY" {
target "login-pnpm" { target "login-pnpm" {
cache-from = [ cache-from = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}" }, { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}" }
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:latest" }, # { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:latest" },
] ]
dockerfile = "dockerfiles/login-pnpm.Dockerfile" dockerfile = "dockerfiles/login-pnpm.Dockerfile"
} }
target "login-dev-base" { target "login-dev-base" {
cache-from = [ cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}"}, {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}"}
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:latest"}, # {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:latest"},
] ]
dockerfile = "dockerfiles/login-dev-base.Dockerfile" dockerfile = "dockerfiles/login-dev-base.Dockerfile"
contexts = { contexts = {
@@ -29,8 +29,8 @@ target "login-dev-base" {
target "login-lint" { target "login-lint" {
cache-from = [ cache-from = [
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}"}, {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}"}
{"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:latest"}, # {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:latest"},
] ]
dockerfile = "dockerfiles/login-lint.Dockerfile" dockerfile = "dockerfiles/login-lint.Dockerfile"
contexts = { contexts = {