Skip to content

Commit e45874b

Browse files
ci: add DH inputs/secrets
Signed-off-by: Patrick Stephens <pat@fluent.do>
1 parent 0506199 commit e45874b

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,12 @@ jobs:
118118
version: ${{ needs.get-meta.outputs.version }}
119119
ref: ${{ github.ref }}
120120
image-base: ${{ matrix.image-base }}
121-
122121
# Pick the Dockerfile to use for each image
123122
definition: ${{ (contains(matrix.image-base, 'debian') && 'Dockerfile.debian') || 'Dockerfile.ubi' }}
123+
dockerhub-username: ${{ vars.DOCKERHUB_USERNAME }}
124+
secrets:
125+
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
126+
124127

125128
# We want to copy the UBI image to ghcr.io/fluentdo/agent:version and
126129
# the distroless image to ghcr.io/fluentdo/agent:version-slim
@@ -214,6 +217,9 @@ jobs:
214217
ref: ${{ github.ref }}
215218
target-matrix: ${{ needs.get-meta.outputs.linux-targets }}
216219
nightly-build-info: ${{ needs.get-meta.outputs.date }}
220+
dockerhub-username: ${{ vars.DOCKERHUB_USERNAME }}
221+
secrets:
222+
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
217223

218224
build-windows:
219225
# Only build Windows packages if we are not a pull request or have a label set

.github/workflows/call-build-containers.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,21 @@ on:
2222
required: false
2323
type: string
2424
default: "Dockerfile.ubi"
25+
dockerhub-username:
26+
description: The Dockerhub username to use for authenticated pulls.
27+
required: false
28+
type: string
29+
default: "fluentdo"
2530
secrets:
2631
cosign_private_key:
2732
description: The optional Cosign key to use for signing the images.
2833
required: false
2934
cosign_private_key_password:
3035
description: If the Cosign key requires a password then specify here, otherwise not required.
3136
required: false
37+
dockerhub-token:
38+
description: The Dockerhub token to use for authenticated pulls (not pushes).
39+
required: true
3240
outputs:
3341
tag:
3442
description: The full image name and tag.
@@ -72,8 +80,8 @@ jobs:
7280
- name: Log in to docker.io for authorised pulls
7381
uses: docker/login-action@v3
7482
with:
75-
username: ${{ vars.DOCKERHUB_USERNAME }}
76-
password: ${{ secrets.DOCKERHUB_TOKEN }}
83+
username: ${{ inputs.dockerhub-username }}
84+
password: ${{ secrets.dockerhub-token }}
7785

7886
- name: Log in to the Container registry
7987
uses: docker/login-action@v3

.github/workflows/call-build-linux-packages.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ on:
1717
required: false
1818
type: string
1919
default: ""
20+
dockerhub-username:
21+
description: The Dockerhub username to use for authenticated pulls.
22+
required: false
23+
type: string
24+
default: "fluentdo"
25+
26+
secrets:
27+
gpg_private_key:
28+
description: The optional GPG key to use for signing the packages.
29+
required: false
30+
gpg_private_key_password:
31+
description: If the GPG key requires a password then specify here, otherwise not required.
32+
required: false
33+
dockerhub-token:
34+
description: The Dockerhub token to use for authenticated pulls (not pushes).
35+
required: true
2036
jobs:
2137
build-packages:
2238
name: agent - ${{ matrix.distro }} package build and upload
@@ -54,8 +70,8 @@ jobs:
5470
- name: Log in to docker.io for authorised pulls
5571
uses: docker/login-action@v3
5672
with:
57-
username: ${{ vars.DOCKERHUB_USERNAME }}
58-
password: ${{ secrets.DOCKERHUB_TOKEN }}
73+
username: ${{ inputs.dockerhub-username }}
74+
password: ${{ secrets.dockerhub-token }}
5975

6076
- name: Log in to the GHCR registry
6177
uses: docker/login-action@v3

0 commit comments

Comments
 (0)