-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-bake.hcl
66 lines (59 loc) · 1.54 KB
/
docker-bake.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Set in GitHub Actions to "tag" or "branch"
variable "GITHUB_REF_TYPE" { default = "" }
// Set in GitHub actions to the branch or tag name, e.g. v0.1.2
variable "GITHUB_REF_NAME" { default = "" }
group "default" {
targets = ["tasks"]
}
group "package" {
// Build the firefox and chrome packages, and run web-ext lint on the firefox
// package.
targets = ["packages", "lint-web-ext"]
}
target "tasks" {
name = task
matrix = {
task = ["lint", "prettier", "typecheck", "test"],
}
target = task
// tests can be non-deterministic, so always re-run them
no-cache-filter = ["test"]
output = ["type=cacheonly"]
}
target "builds" {
name = "build-${browser}-${release}"
matrix = {
browser = ["chrome", "firefox"]
release = ["development", "production"]
}
target = "built-files"
args = {
BROWSER = browser
RELEASE = release
}
output = ["type=local,dest=dist/${browser}-${release}"]
}
function "build_tag" {
params = []
result = GITHUB_REF_TYPE == "tag" ? GITHUB_REF_NAME : ""
}
target "packages" {
name = "package-${browser}"
matrix = {
browser = ["chrome", "firefox"]
}
target = "packaged-files"
args = {
BROWSER = browser
RELEASE = "production"
BUILD_TAG = build_tag()
}
output = ["type=local,dest=dist/packages/${browser}-production"]
}
// Runs web-ext lint on the Firefox build to catch issues that will be reported
// when we submit to Firefox Add-ons.
target "lint-web-ext" {
inherits = ["package-firefox"]
target = "lint-web-ext"
output = ["type=cacheonly"]
}