mirror of
https://github.com/docker/metadata-action.git
synced 2025-01-15 05:48:03 +01:00
Merge pull request #494 from crazy-max/bake-v6
update bake-action to v6
This commit is contained in:
commit
8e1d5461f0
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@ -392,12 +392,12 @@ jobs:
|
||||
type=sha
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||
targets: |
|
||||
release
|
||||
|
||||
@ -504,12 +504,12 @@ jobs:
|
||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
${{ steps.docker_meta.outputs.bake-file-annotations }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-annotations }}
|
||||
targets: |
|
||||
release
|
||||
|
||||
@ -539,7 +539,7 @@ jobs:
|
||||
name: Print envs
|
||||
run: env|sort
|
||||
|
||||
bake-cwd:
|
||||
bake-path-context:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
@ -556,13 +556,13 @@ jobs:
|
||||
uses: ./
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
source: "{{defaultContext}}"
|
||||
source: .
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||
${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||
targets: |
|
||||
release
|
||||
|
||||
|
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@ -15,12 +15,9 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
|
16
.github/workflows/validate.yml
vendored
16
.github/workflows/validate.yml
vendored
@ -15,16 +15,17 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.targets.outputs.matrix }}
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Targets matrix
|
||||
id: targets
|
||||
run: |
|
||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
with:
|
||||
target: validate
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
@ -35,11 +36,8 @@ jobs:
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
48
README.md
48
README.md
@ -92,7 +92,7 @@ jobs:
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
@ -152,7 +152,7 @@ jobs:
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
@ -206,9 +206,6 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
@ -224,11 +221,11 @@ jobs:
|
||||
type=sha
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
cwd://${{ steps.meta.outputs.bake-file }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
@ -271,29 +268,12 @@ similar to the previous one:
|
||||
```yaml
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file-tags }}
|
||||
${{ steps.meta.outputs.bake-file-labels }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
If you're building a [remote Bake definition](https://docs.docker.com/build/bake/remote-definition/)
|
||||
using a [Git context](https://github.com/docker/bake-action?tab=readme-ov-file#git-context),
|
||||
you must specify the location of the metadata-only bake file using a `cwd://`
|
||||
prefix:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v5
|
||||
with:
|
||||
source: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}"
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
cwd://${{ steps.meta.outputs.bake-file }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-labels }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
@ -353,7 +333,7 @@ Alternatively, each output is also exported as an environment variable:
|
||||
So it can be used with our [Docker Build Push action](https://github.com/docker/build-push-action/):
|
||||
|
||||
```yaml
|
||||
- uses: docker/build-push-action@v5
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
build-args: |
|
||||
DOCKER_METADATA_OUTPUT_JSON
|
||||
@ -945,7 +925,7 @@ that you can reuse them further in your workflow using the [`fromJSON` function]
|
||||
images: name/app
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@ -992,7 +972,7 @@ of the `metadata-action`:
|
||||
images: name/app
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
annotations: ${{ steps.meta.outputs.annotations }}
|
||||
@ -1008,12 +988,12 @@ The same can be done with the [`bake-action`](https://github.com/docker/bake-act
|
||||
images: name/app
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v5
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file-tags }}
|
||||
${{ steps.meta.outputs.bake-file-annotations }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-annotations }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
@ -1039,7 +1019,7 @@ Please consult the documentation of your registry.
|
||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
annotations: ${{ steps.meta.outputs.annotations }}
|
||||
|
@ -1,3 +1,9 @@
|
||||
target "_common" {
|
||||
args = {
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||
}
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
@ -11,42 +17,49 @@ group "validate" {
|
||||
}
|
||||
|
||||
target "build" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "build-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "format" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "format-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "lint"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "vendor" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "vendor-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user