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"
packages: "write"
steps:
- uses: actions/checkout@v4
- name: Set up Docker
# 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
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
daemon-config: |
{
"features": {
"containerd-snapshotter": true
}
}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
@@ -35,17 +29,9 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up persistent Buildx builder
- name: Set up Buildx docker-container builder
id: buildx
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
uses: docker/bake-action@v6
env:

View File

@@ -4,25 +4,25 @@ target "login-pnpm" {
cache-to = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}", "mode": "max" }
]
output = [
{ "type" : "image", "name": "${IMAGE_REGISTRY}/login-pnpm:${BUILD_CACHE_KEY}", push: true },
]
# output = [
# { "type" : "image", "name": "${IMAGE_REGISTRY}/login-pnpm:${BUILD_CACHE_KEY}", push: true },
# ]
}
target "login-dev-base" {
cache-to = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}", "mode": "max" }
]
output = [
{ "type" : "image", "name": "${IMAGE_REGISTRY}/login-dev-base:${BUILD_CACHE_KEY}", push: true },
]
# output = [
# { "type" : "image", "name": "${IMAGE_REGISTRY}/login-dev-base:${BUILD_CACHE_KEY}", push: true },
# ]
}
target "login-lint" {
cache-to = [
{ "type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}", "mode": "max" }
]
output = [
{ "type" : "image", "name": "${IMAGE_REGISTRY}/login-lint:${BUILD_CACHE_KEY}", push: true },
]
# output = [
# { "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" {
cache-from = [
{ "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:${BUILD_CACHE_KEY}" }
# { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:latest" },
]
dockerfile = "dockerfiles/login-pnpm.Dockerfile"
}
target "login-dev-base" {
cache-from = [
{"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:${BUILD_CACHE_KEY}"}
# {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:latest"},
]
dockerfile = "dockerfiles/login-dev-base.Dockerfile"
contexts = {
@@ -29,8 +29,8 @@ target "login-dev-base" {
target "login-lint" {
cache-from = [
{"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:${BUILD_CACHE_KEY}"}
# {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:latest"},
]
dockerfile = "dockerfiles/login-lint.Dockerfile"
contexts = {