Skip to content

Commit

Permalink
create gha-build bake target
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gilber committed Oct 30, 2023
1 parent 2fa8176 commit d0dabf9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ jobs:
set: |
build.args.BUILD_IMAGE=${{ env.BUILD_IMAGE }}
build.args.RUNTIME_IMAGE=${{ env.RUNTIME_IMAGE }}
targets: build
targets: gha-build
push: true
26 changes: 26 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
// Configuration for docker/bake-action: https://github.com/docker/bake-action
// https://github.com/marketplace/actions/docker-metadata-action#bake-definition
// docker-bake.hcl

target "docker-metadata-action" {}

// Create Base Build Target
target "build" {
inherits = ["docker-metadata-action"]
context = "./"
// Use multi-stage Containerfile
dockerfile = "Containerfile.multistage"
}

// Create Platforms Target
target "platforms" {
// Set target platforms for multi-platform builds https://docs.docker.com/build/bake/reference/#targetplatforms
platforms = [
"linux/amd64",
"linux/arm64"
]
}

// Create Multi Platform Build Target
target "multi-platform-build" {
inherits = ["build", "platforms"]
}

// Create GitHub Action Cache Target
target "gha-cache" {
cache-from = [
"type=gha"
]
cache-to = [
"type=gha,mode=max"
]
}

// Create GitHub Action Build Target
target "gha-build" {
inherits = ["multi-platform-build", "gha-cache"]
}

0 comments on commit d0dabf9

Please sign in to comment.