depot builder

This commit is contained in:
Elio Bischof
2025-07-31 03:17:34 +02:00
parent e0a0ae9e1c
commit c1685f2724
5 changed files with 10 additions and 20 deletions

View File

@@ -19,6 +19,7 @@ permissions:
issues: write issues: write
pull-requests: write pull-requests: write
actions: write actions: write
id-token: write
jobs: jobs:
core: core:

View File

@@ -17,6 +17,7 @@ on:
permissions: permissions:
packages: write packages: write
id-token: write
env: env:
default_labels: | default_labels: |
@@ -27,9 +28,10 @@ env:
jobs: jobs:
login-container: login-container:
name: Build Login Container name: Build Login Container
runs-on: depot-ubuntu-22.04-8 runs-on: ubuntu-latest
permissions: permissions:
packages: write packages: write
id-token: write
outputs: outputs:
login_build_image: ${{ steps.short-sha.outputs.login_build_image }} login_build_image: ${{ steps.short-sha.outputs.login_build_image }}
steps: steps:
@@ -63,21 +65,19 @@ jobs:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx - name: Set up Depot CLI
id: setup-buildx uses: depot/setup-action@v1
uses: docker/setup-buildx-action@v3
- name: Bake login multi-arch - name: Bake login multi-arch
uses: docker/bake-action@v6 uses: depot/bake-action@v1
env: env:
NODE_VERSION: ${{ inputs.node_version }} NODE_VERSION: ${{ inputs.node_version }}
with: with:
source: . project: w47wkxzdtw
push: true push: true
provenance: true provenance: true
sbom: true # Only build for multiple platforms if triggered by workflow_dispatch
targets: login-standalone platforms: ${{ github.event_name == 'workflow_dispatch' && 'linux/amd64,linux/arm64' || '' }}
files: | files: |
./apps/login/docker-bake.hcl ./apps/login/docker-bake.hcl
${{ github.event_name == 'workflow_dispatch' && './apps/login/docker-bake-release.hcl' || '' }}
./docker-bake.hcl ./docker-bake.hcl
cwd://${{ steps.login-meta.outputs.bake-file }} cwd://${{ steps.login-meta.outputs.bake-file }}

View File

@@ -1,3 +0,0 @@
target "release" {
platforms = ["linux/amd64", "linux/arm64"]
}

View File

@@ -6,11 +6,6 @@ group "default" {
targets = ["login-standalone"] targets = ["login-standalone"]
} }
# The release target is overwritten in docker-bake-release.hcl
# It makes sure the image is built for multiple platforms.
# By default the platforms property is empty, so images are only built for the current bake runtime platform.
target "release" {}
target "docker-metadata-action" { target "docker-metadata-action" {
# In the pipeline, this target is overwritten by the docker metadata action. # In the pipeline, this target is overwritten by the docker metadata action.
tags = ["${LOGIN_TAG}"] tags = ["${LOGIN_TAG}"]
@@ -20,6 +15,5 @@ target "docker-metadata-action" {
target "login-standalone" { target "login-standalone" {
inherits = [ inherits = [
"docker-metadata-action", "docker-metadata-action",
"release",
] ]
} }

View File

@@ -1,8 +1,6 @@
# login-standalone should be extended by the login-standalone target in apps/login/docker-bake.hcl # login-standalone should be extended by the login-standalone target in apps/login/docker-bake.hcl
target "login-standalone" { target "login-standalone" {
dockerfile = "build/login/Dockerfile" dockerfile = "build/login/Dockerfile"
cache-from = ["type=gha,scope=login-build-{{.Platform}}"]
cache-to = ["type=gha,mode=max,scope=login-build-{{.Platform}}"]
} }
target "login-standalone-out" { target "login-standalone-out" {