Update workflow

This commit is contained in:
CrazyMax 2020-12-24 03:57:45 +01:00
parent fc26125e64
commit 13836f0377
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
3 changed files with 77 additions and 7 deletions

View File

@ -177,3 +177,38 @@ jobs:
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v1
bake:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: docker_meta
uses: ./
with:
images: |
${{ env.DOCKER_IMAGE }}
ghcr.io/name/app
tag-sha: true
tag-semver: |
{{version}}
{{major}}.{{minor}}
{{major}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
uses: crazy-max/ghaction-docker-buildx-bake@v1
with:
files: |
./test/docker-bake.hcl
${{ steps.docker_meta.outputs.bake-file }}
targets: |
release

View File

@ -171,15 +171,11 @@ target named `ghaction-docker-meta`.
```hcl
// docker-bake.hcl
target "ghaction-docker-meta" {
tags = ["crazymax/diun:local"]
labels = {
"maintainer" = "CrazyMax"
}
}
target "ghaction-docker-meta" {}
target "build" {
inherits = ["docker-meta"]
inherits = ["ghaction-docker-meta"]
context = "./"
dockerfile = "Dockerfile"
platforms = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/386", "linux/ppc64le"]

39
test/docker-bake.hcl Normal file
View File

@ -0,0 +1,39 @@
group "default" {
targets = ["db", "app"]
}
group "release" {
targets = ["db", "app-plus"]
}
target "db" {
context = "./test"
tags = ["docker.io/tonistiigi/db"]
}
target "app" {
context = "./test"
dockerfile = "Dockerfile"
args = {
name = "foo"
}
tags = [
"localhost:5000/name/app:latest",
"localhost:5000/name/app:1.0.0"
]
}
target "cross" {
platforms = [
"linux/amd64",
"linux/arm64",
"linux/386"
]
}
target "app-plus" {
inherits = ["app", "cross"]
args = {
IAMPLUS = "true"
}
}