Skip to content

Commit bbd1d03

Browse files
committed
ci: test --version after build
1 parent f1438fb commit bbd1d03

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

.github/actions/docker-build/action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# Action that wraps together all the necessary actions to build an image and publish it.
22
# It does not include login actions.
33
# This is a convenience, so that we know that everything related to the build lies in this file,
4-
# and if it gets updated we can automatically run our `test-docker-build` from `build-test.yml.`
4+
# and if it gets updated we can automatically run our `test-docker-build` from `build-test.yml.`,
5+
# so there is no confusion about which is the job that was updated, if there are many in the same workflow file.
56

67
name: "Docker Build"
78
description: "Builds Docker images with optional caching and multi-platform support"
89

910
inputs:
10-
push-image:
11+
push:
1112
description: "Whether to push the built image"
1213
required: false
1314
default: "false"
15+
load:
16+
description: "Whether to load the built image"
17+
required: false
18+
default: "false"
1419
platforms:
1520
description: "Target platforms for the build"
1621
required: false
@@ -55,9 +60,10 @@ runs:
5560
with:
5661
context: ${{ inputs.context }}
5762
file: ${{ inputs.dockerfile }}
58-
push: ${{ inputs['push-image'] }}
63+
push: ${{ inputs.push }}
5964
platforms: ${{ inputs.platforms }}
6065
tags: ${{ steps.meta.outputs.tags }}
6166
labels: ${{ steps.meta.outputs.labels }}
6267
cache-from: ${{ inputs['cache-from'] }}
6368
cache-to: ${{ inputs['cache-to'] }}
69+
load: ${{ inputs.load }}

.github/workflows/build-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ jobs:
9696
context: .
9797
file: ./Dockerfile
9898
push: false
99+
load: true
99100
platforms: linux/amd64,linux/arm64
100101
cache-from: type=registry,ref=ghcr.io/elementsinteractive/twyn:buildcache
101-
102+
tags: test-build
103+
104+
- name: Test
105+
run: |
106+
docker run --rm test-build --version

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Build and push Docker image
5454
uses: ./.github/actions/docker-build
5555
with:
56-
push-image: "true"
56+
push: "true"
5757
platforms: linux/amd64,linux/arm64
5858
dockerfile: ./Dockerfile
5959
context: .

0 commit comments

Comments
 (0)