Skip to content

Commit b276342

Browse files
committed
Fix docker image build ci
1 parent 4d97f88 commit b276342

3 files changed

Lines changed: 20 additions & 44 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,36 +48,18 @@ jobs:
4848
type=sha
4949
# set latest tag for stable releases
5050
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
51-
bake-target: openmodmail
51+
bake-target: docker-metadata-action
5252

53-
- name: Extract metadata (tags, labels) for Docker supportutils
54-
id: docker-meta-supportutils
55-
uses: docker/metadata-action@v5
56-
with:
57-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
58-
flavor: |
59-
suffix=-supportutils,onlatest=true
60-
tags: |
61-
type=semver,pattern={{version}}
62-
type=semver,pattern={{major}}.{{minor}}
63-
type=semver,pattern={{major}}
64-
type=ref,event=branch
65-
type=ref,event=pr
66-
type=sha
67-
# set latest tag for stable releases
68-
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
69-
bake-target: openmodmail-supportutils
70-
7153
- name: Build and push
7254
uses: docker/bake-action@v6
7355
with:
74-
push: ${{ ! startsWith(github.ref, 'refs/pull/') }}
56+
# source: .
57+
push: ${{ ! startsWith(github.ref, 'refs/pull/') && ! github.event.act }}
7558
pull: true
7659
sbom: true
7760
files: |
7861
./docker-bake.hcl
7962
cwd://${{ steps.docker-meta-base.outputs.bake-file }}
80-
cwd://${{ steps.docker-meta-supportutils.outputs.bake-file }}
81-
targets: openmodmail,openmodmail-supportutils
63+
targets: openmodmail
8264

8365

docker-bake.hcl

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,24 @@ target "_common" {
55
platforms = ["linux/amd64", "linux/arm64"]
66
}
77

8+
# placeholder for docker-metadata-action target data
9+
target "docker-metadata-action" {
10+
tags = []
11+
}
12+
813
target "openmodmail" {
9-
name = "openmodmail${notequal("",INCLUDE_SUPPORTUTILS) ? "-supportutils" : ""}${notequal("",INCLUDE_PIP) ? "-pip" : ""}"
10-
inherits = ["_common"]
14+
name = "openmodmail${notequal("true",include-supportutils) ? "" : "-supportutils"}${notequal("true",include-pip) ? "" : "-pip"}"
15+
inherits = ["_common", "docker-metadata-action"]
1116
context = "."
1217
dockerfile = "Dockerfile"
1318
matrix = {
14-
INCLUDE_SUPPORTUTILS = ["true", ""]
15-
INCLUDE_PIP = ["true", ""]
19+
include-supportutils = ["true", "false"]
20+
include-pip = ["true", "false"]
1621
}
22+
args = {
23+
INCLUDE_SUPPORTUTILS = include-supportutils
24+
INCLUDE_PIP = include-pip
25+
}
26+
# take the tags from the docker-metadata-action target and append the suffixes based on the matrix values
27+
tags = [for tag in target.docker-metadata-action.tags : "${tag}${notequal("true",include-supportutils) ? "" : "-supportutils"}${notequal("true",include-pip) ? "" : "-pip"}"]
1728
}
18-
19-
# target "openmodmail-supportutils" {
20-
# inherits = ["_common"]
21-
# context = "."
22-
# dockerfile = "Dockerfile"
23-
# args = {
24-
# INCLUDE_SUPPORTUTILS = "true"
25-
# }
26-
# }
27-
#
28-
# target "openmodmail-pip" {
29-
# inherits = ["_common"]
30-
# context = "."
31-
# dockerfile = "Dockerfile"
32-
# args = {
33-
# INCLUDE_PIP = "true"
34-
# }
35-
# }

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[tools]
2+
act = "latest"
23
pdm = "latest"
34
python = "3.12"

0 commit comments

Comments
 (0)