Skip to content

Commit 15ce257

Browse files
committed
ci: test bake reusable workflow
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 1df786a commit 15ce257

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,20 @@ jobs:
3838
targets: releaser-build
3939

4040
build:
41+
uses: docker/github-builder-experimental/.github/workflows/bake.yml@main
42+
permissions:
43+
contents: read
44+
packages: write
45+
id-token: write
46+
with:
47+
output: local
48+
target: release
49+
50+
check-cloudfront:
4151
runs-on: ubuntu-24.04
4252
needs:
4353
- releaser
4454
steps:
45-
-
46-
name: Checkout
47-
uses: actions/checkout@v5
48-
-
49-
name: Set up Docker Buildx
50-
uses: docker/setup-buildx-action@v3
51-
-
52-
name: Build
53-
uses: docker/bake-action@v6
54-
with:
55-
source: .
56-
files: |
57-
docker-bake.hcl
58-
targets: release
5955
-
6056
name: Check Cloudfront config
6157
uses: docker/bake-action@v6
@@ -69,7 +65,11 @@ jobs:
6965
AWS_LAMBDA_FUNCTION: DockerDocsRedirectFunction-dummy
7066

7167
validate:
72-
runs-on: ubuntu-24.04
68+
uses: docker/github-builder-experimental/.github/workflows/bake.yml@main
69+
permissions:
70+
contents: read
71+
packages: write
72+
id-token: write
7373
strategy:
7474
fail-fast: false
7575
matrix:
@@ -82,29 +82,28 @@ jobs:
8282
- dockerfile-lint
8383
- path-warnings
8484
- validate-vendor
85+
with:
86+
output: local
87+
target: ${{ matrix.target }}
88+
artifact-name: ${{ matrix.target }}
89+
90+
reviewdog:
91+
runs-on: ubuntu-24.04
92+
needs: validate
93+
if: ${{ github.event_name == 'pull_request' }}
8594
steps:
8695
-
87-
name: Checkout
88-
uses: actions/checkout@v5
89-
-
90-
name: Set up Docker Buildx
91-
uses: docker/setup-buildx-action@v3
92-
-
93-
name: Validate
94-
uses: docker/bake-action@v6
96+
name: Download vale output
97+
uses: actions/download-artifact@v4
9598
with:
96-
source: .
97-
files: |
98-
docker-bake.hcl
99-
targets: ${{ matrix.target }}
99+
name: vale
100+
path: ./vale-output
100101
-
101102
name: Install reviewdog
102-
if: ${{ matrix.target == 'vale' && github.event_name == 'pull_request' }}
103103
uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
104104
-
105105
name: Run reviewdog for vale
106-
if: ${{ matrix.target == 'vale' && github.event_name == 'pull_request' }}
107106
run: |
108-
cat ./tmp/vale.out | reviewdog -f=rdjsonl -name=vale -reporter=github-pr-annotations -fail-on-error=false -filter-mode=added -level=info -fail-level=warning
107+
cat ./vale-output/vale.out | reviewdog -f=rdjsonl -name=vale -reporter=github-pr-annotations -fail-on-error=false -filter-mode=added -level=info -fail-level=warning
109108
env:
110109
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ COPY . .
4444

4545
# build creates production builds with Hugo
4646
FROM build-base AS build
47+
ARG BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
4748
# HUGO_ENV sets the hugo.Environment (production, development, preview)
4849
ARG HUGO_ENV="development"
4950
# DOCS_URL sets the base URL for the site
@@ -123,6 +124,7 @@ EOT
123124

124125
# build-upstream builds an upstream project with a replacement module
125126
FROM build-base AS build-upstream
127+
ARG BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
126128
# UPSTREAM_MODULE_NAME is the canonical upstream repository name and namespace (e.g. moby/buildkit)
127129
ARG UPSTREAM_MODULE_NAME
128130
# UPSTREAM_REPO is the repository of the project to validate (e.g. dvdksn/buildkit)
@@ -148,6 +150,7 @@ RUN --mount=type=bind,target=. ./hack/test/unused_media
148150

149151
# path-warnings checks for duplicate target paths
150152
FROM build-base AS path-warnings
153+
ARG BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
151154
RUN hugo --printPathWarnings > ./path-warnings.txt
152155
RUN <<EOT
153156
DUPLICATE_TARGETS=$(grep "Duplicate target paths" ./path-warnings.txt)

0 commit comments

Comments
 (0)