Skip to content

Commit aae4902

Browse files
authored
Merge pull request #65 from Staffbase/add-possibility-to-pass-docker-build-secrets
add possibility to pass docker build secrets to the build step
2 parents d0f4804 + c115634 commit aae4902

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,26 @@ jobs:
105105
106106
## Inputs
107107
108-
| Name | Description | Default |
109-
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------|--------------------------|
110-
| `docker-registry` | Docker Registry | `staffbase.jfrog.io` |
111-
| `docker-image` | Docker Image | |
112-
| `docker-username` | Username for the Docker Registry | |
113-
| `docker-password` | Password for the Docker Registry | |
114-
| `docker-file` | Dockerfile | `./Dockerfile` |
115-
| `docker-build-args` | List of build-time variables | |
116-
| `docker-build-target` | Sets the target stage to build like: "runtime" | |
117-
| `gitops-organization` | GitHub Organization for GitOps | `Staffbase` |
118-
| `gitops-repository` | GitHub Repository for GitOps | `mops` |
119-
| `gitops-user` | GitHub User for GitOps | `Staffbot` |
120-
| `gitops-email` | GitHub Email for GitOps | `[email protected]` |
121-
| `gitops-token` | GitHub Token for GitOps | |
122-
| `gitops-dev` | Files which should be updated by the GitHub Action for DEV, must be relative to the root of the GitOps repository | |
123-
| `gitops-stage` | Files which should be updated by the GitHub Action for STAGE, must be relative to the root of the GitOps repository | |
124-
| `gitops-prod` | Files which should be updated by the GitHub Action for PROD, must be relative to the root of the GitOps repository | |
125-
| `working-directory` | The directory in which the GitOps action should be executed. The docker-file variable should be relative to working directory. | `.` |
108+
| Name | Description | Default |
109+
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------|--------------------------|
110+
| `docker-registry` | Docker Registry | `staffbase.jfrog.io` |
111+
| `docker-image` | Docker Image | |
112+
| `docker-username` | Username for the Docker Registry | |
113+
| `docker-password` | Password for the Docker Registry | |
114+
| `docker-file` | Dockerfile | `./Dockerfile` |
115+
| `docker-build-args` | List of build-time variables | |
116+
| `docker-build-secrets` | List of secrets to expose to the build (e.g., key=string, GIT_AUTH_TOKEN=mytoken) | |
117+
| `docker-build-secret-files` | List of secret files to expose to the build (e.g., key=filename, MY_SECRET=./secret.txt) | |
118+
| `docker-build-target` | Sets the target stage to build like: "runtime" | |
119+
| `gitops-organization` | GitHub Organization for GitOps | `Staffbase` |
120+
| `gitops-repository` | GitHub Repository for GitOps | `mops` |
121+
| `gitops-user` | GitHub User for GitOps | `Staffbot` |
122+
| `gitops-email` | GitHub Email for GitOps | `[email protected]` |
123+
| `gitops-token` | GitHub Token for GitOps | |
124+
| `gitops-dev` | Files which should be updated by the GitHub Action for DEV, must be relative to the root of the GitOps repository | |
125+
| `gitops-stage` | Files which should be updated by the GitHub Action for STAGE, must be relative to the root of the GitOps repository | |
126+
| `gitops-prod` | Files which should be updated by the GitHub Action for PROD, must be relative to the root of the GitOps repository | |
127+
| `working-directory` | The directory in which the GitOps action should be executed. The docker-file variable should be relative to working directory. | `.` |
126128

127129
## Contributing
128130

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ inputs:
2323
docker-build-args:
2424
description: "List of build-time variables"
2525
required: false
26+
docker-build-secrets:
27+
description: "List of secrets to expose to the build (e.g., key=string, GIT_AUTH_TOKEN=mytoken)"
28+
required: false
29+
docker-build-secret-files:
30+
description: "List of secret files to expose to the build (e.g., key=filename, MY_SECRET=./secret.txt)"
31+
required: false
2632
docker-build-target:
2733
description: "Sets the target stage to build"
2834
required: false
@@ -129,6 +135,8 @@ runs:
129135
target: ${{ inputs.docker-build-target }}
130136
build-args: ${{ inputs.docker-build-args }}
131137
tags: ${{ steps.preparation.outputs.tag_list }}
138+
secrets: ${{ inputs.docker-build-secrets }}
139+
secret-files: ${{ inputs.docker-build-secret-files }}
132140
platforms: linux/amd64
133141
cache-from: type=gha
134142
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)