Skip to content

Commit

Permalink
Merge pull request #65 from Staffbase/add-possibility-to-pass-docker-…
Browse files Browse the repository at this point in the history
…build-secrets

add possibility to pass docker build secrets to the build step
  • Loading branch information
staust authored May 26, 2023
2 parents d0f4804 + c115634 commit aae4902
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,26 @@ jobs:
## Inputs
| Name | Description | Default |
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------|--------------------------|
| `docker-registry` | Docker Registry | `staffbase.jfrog.io` |
| `docker-image` | Docker Image | |
| `docker-username` | Username for the Docker Registry | |
| `docker-password` | Password for the Docker Registry | |
| `docker-file` | Dockerfile | `./Dockerfile` |
| `docker-build-args` | List of build-time variables | |
| `docker-build-target` | Sets the target stage to build like: "runtime" | |
| `gitops-organization` | GitHub Organization for GitOps | `Staffbase` |
| `gitops-repository` | GitHub Repository for GitOps | `mops` |
| `gitops-user` | GitHub User for GitOps | `Staffbot` |
| `gitops-email` | GitHub Email for GitOps | `staffbot@staffbase.com` |
| `gitops-token` | GitHub Token for GitOps | |
| `gitops-dev` | Files which should be updated by the GitHub Action for DEV, must be relative to the root of the GitOps repository | |
| `gitops-stage` | Files which should be updated by the GitHub Action for STAGE, must be relative to the root of the GitOps repository | |
| `gitops-prod` | Files which should be updated by the GitHub Action for PROD, must be relative to the root of the GitOps repository | |
| `working-directory` | The directory in which the GitOps action should be executed. The docker-file variable should be relative to working directory. | `.` |
| Name | Description | Default |
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------|--------------------------|
| `docker-registry` | Docker Registry | `staffbase.jfrog.io` |
| `docker-image` | Docker Image | |
| `docker-username` | Username for the Docker Registry | |
| `docker-password` | Password for the Docker Registry | |
| `docker-file` | Dockerfile | `./Dockerfile` |
| `docker-build-args` | List of build-time variables | |
| `docker-build-secrets` | List of secrets to expose to the build (e.g., key=string, GIT_AUTH_TOKEN=mytoken) | |
| `docker-build-secret-files` | List of secret files to expose to the build (e.g., key=filename, MY_SECRET=./secret.txt) | |
| `docker-build-target` | Sets the target stage to build like: "runtime" | |
| `gitops-organization` | GitHub Organization for GitOps | `Staffbase` |
| `gitops-repository` | GitHub Repository for GitOps | `mops` |
| `gitops-user` | GitHub User for GitOps | `Staffbot` |
| `gitops-email` | GitHub Email for GitOps | `staffbot@staffbase.com` |
| `gitops-token` | GitHub Token for GitOps | |
| `gitops-dev` | Files which should be updated by the GitHub Action for DEV, must be relative to the root of the GitOps repository | |
| `gitops-stage` | Files which should be updated by the GitHub Action for STAGE, must be relative to the root of the GitOps repository | |
| `gitops-prod` | Files which should be updated by the GitHub Action for PROD, must be relative to the root of the GitOps repository | |
| `working-directory` | The directory in which the GitOps action should be executed. The docker-file variable should be relative to working directory. | `.` |

## Contributing

Expand Down
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ inputs:
docker-build-args:
description: "List of build-time variables"
required: false
docker-build-secrets:
description: "List of secrets to expose to the build (e.g., key=string, GIT_AUTH_TOKEN=mytoken)"
required: false
docker-build-secret-files:
description: "List of secret files to expose to the build (e.g., key=filename, MY_SECRET=./secret.txt)"
required: false
docker-build-target:
description: "Sets the target stage to build"
required: false
Expand Down Expand Up @@ -129,6 +135,8 @@ runs:
target: ${{ inputs.docker-build-target }}
build-args: ${{ inputs.docker-build-args }}
tags: ${{ steps.preparation.outputs.tag_list }}
secrets: ${{ inputs.docker-build-secrets }}
secret-files: ${{ inputs.docker-build-secret-files }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down

0 comments on commit aae4902

Please sign in to comment.