Merge pull request #21735 from crazy-max/bake-v6

update bake-action to v6
This commit is contained in:
CrazyMax 2025-01-08 18:55:25 +01:00 committed by GitHub
commit 2db1648b57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 27 additions and 45 deletions

View File

@ -23,9 +23,6 @@ jobs:
releaser: releaser:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
-
name: Checkout
uses: actions/checkout@v4
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
@ -34,7 +31,7 @@ jobs:
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }} driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
- -
name: Build name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
files: | files: |
docker-bake.hcl docker-bake.hcl
@ -56,8 +53,9 @@ jobs:
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- -
name: Build name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
source: .
files: | files: |
docker-bake.hcl docker-bake.hcl
targets: release targets: release
@ -66,8 +64,9 @@ jobs:
*.cache-to=type=gha,scope=build,mode=max *.cache-to=type=gha,scope=build,mode=max
- -
name: Check Cloudfront config name: Check Cloudfront config
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
source: .
targets: aws-cloudfront-update targets: aws-cloudfront-update
env: env:
DRY_RUN: true DRY_RUN: true
@ -99,20 +98,18 @@ jobs:
- dockerfile-lint - dockerfile-lint
- path-warnings - path-warnings
steps: steps:
-
name: Checkout
uses: actions/checkout@v4
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- -
name: Validate name: Validate
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
files: | files: |
docker-bake.hcl docker-bake.hcl
targets: ${{ matrix.target }} targets: ${{ matrix.target }}
set: | set: |
*.args.BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
*.cache-to=type=gha,scope=validate-${{ matrix.target }},mode=max *.cache-to=type=gha,scope=validate-${{ matrix.target }},mode=max
*.cache-from=type=gha,scope=validate-${{ matrix.target }} *.cache-from=type=gha,scope=validate-${{ matrix.target }}
*.cache-from=type=gha,scope=build *.cache-from=type=gha,scope=build

View File

@ -90,8 +90,9 @@ jobs:
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }} driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
- -
name: Build website name: Build website
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
source: .
files: | files: |
docker-bake.hcl docker-bake.hcl
targets: release targets: release
@ -127,8 +128,9 @@ jobs:
- -
name: Update S3 config name: Update S3 config
if: ${{ env.DOCS_S3_BUCKET != '' && env.DOCS_S3_CONFIG != '' }} if: ${{ env.DOCS_S3_BUCKET != '' && env.DOCS_S3_CONFIG != '' }}
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
source: .
files: | files: |
docker-bake.hcl docker-bake.hcl
targets: aws-s3-update-config targets: aws-s3-update-config
@ -141,8 +143,9 @@ jobs:
- -
name: Update Cloudfront config name: Update Cloudfront config
if: ${{ env.DOCS_CLOUDFRONT_ID != '' }} if: ${{ env.DOCS_CLOUDFRONT_ID != '' }}
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
source: .
files: | files: |
docker-bake.hcl docker-bake.hcl
targets: aws-cloudfront-update targets: aws-cloudfront-update

View File

@ -90,8 +90,9 @@ jobs:
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }} driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
- -
name: Validate name: Validate
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
source: .
files: | files: |
docker-bake.hcl docker-bake.hcl
targets: validate-upstream targets: validate-upstream

View File

@ -174,9 +174,8 @@ and use the `cwd://` prefix for the metadata Bake file:
```yml ```yml
- name: Build - name: Build
uses: docker/bake-action@v4 uses: docker/bake-action@v6
with: with:
source: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}"
files: | files: |
./docker-bake.hcl ./docker-bake.hcl
cwd://${{ steps.meta.outputs.bake-file }} cwd://${{ steps.meta.outputs.bake-file }}

View File

@ -72,9 +72,6 @@ jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
@ -91,12 +88,12 @@ jobs:
images: ${{ env.IMAGE_NAME }} images: ${{ env.IMAGE_NAME }}
- name: Build - name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
files: | files: |
./docker-bake.hcl ./docker-bake.hcl
${{ steps.meta.outputs.bake-file-tags }} cwd://${{ steps.meta.outputs.bake-file-tags }}
${{ steps.meta.outputs.bake-file-annotations }} cwd://${{ steps.meta.outputs.bake-file-annotations }}
push: true push: true
``` ```

View File

@ -20,7 +20,7 @@ or [Docker Buildx Bake](https://github.com/marketplace/actions/docker-buildx-bak
GitHub Actions: GitHub Actions:
- `docker/build-push-action@v6` - `docker/build-push-action@v6`
- `docker/bake-action@v5` - `docker/bake-action@v6`
To view the job summary, open the details page for the job in GitHub after the To view the job summary, open the details page for the job in GitHub after the
job has finished. The summary is available for both failed and successful job has finished. The summary is available for both failed and successful

View File

@ -78,9 +78,6 @@ jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
@ -91,12 +88,12 @@ jobs:
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Validate build configuration - name: Validate build configuration
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
targets: validate-build targets: validate-build
- name: Build - name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
targets: build targets: build
push: true push: true

View File

@ -350,9 +350,6 @@ jobs:
platform=${{ matrix.platform }} platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Download meta bake definition - name: Download meta bake definition
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
@ -373,11 +370,11 @@ jobs:
- name: Build - name: Build
id: bake id: bake
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
files: | files: |
./docker-bake.hcl ./docker-bake.hcl
/tmp/bake-meta.json cwd:///tmp/bake-meta.json
targets: image targets: image
set: | set: |
*.tags= *.tags=

View File

@ -56,14 +56,11 @@ jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Build - name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
env: env:
SOURCE_DATE_EPOCH: 0 SOURCE_DATE_EPOCH: 0
``` ```
@ -115,9 +112,6 @@ jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
@ -125,7 +119,7 @@ jobs:
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
- name: Build - name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
env: env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }} SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
``` ```

View File

@ -198,9 +198,6 @@ jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up SSH - name: Set up SSH
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0 uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0
with: with:
@ -209,7 +206,7 @@ jobs:
private-key-name: github-ppk private-key-name: github-ppk
- name: Build - name: Build
uses: docker/bake-action@v5 uses: docker/bake-action@v6
with: with:
set: | set: |
*.ssh=default *.ssh=default