Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all options with our defaults to reusable workflow #244

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/template_gitops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ name: GitOps
on:
workflow_call:
inputs:
docker-registry:
required: false
type: string
default: "staffbase.jfrog.io"
docker-build-args:
required: false
type: string
docker-build-target:
required: false
type: string
docker-build-provenance:
required: false
type: string
default: "false"
docker-file:
required: false
type: string
Expand All @@ -30,6 +38,18 @@ on:
required: false
type: string
default: ${{ github.repository_owner }}
gitops-repository:
required: false
type: string
default: "mops"
gitops-user:
required: false
type: string
default: "Staffbot"
gitops-email:
required: false
type: string
default: "[email protected]"
working-directory:
required: false
type: string
Expand Down Expand Up @@ -79,6 +99,7 @@ jobs:
- name: GitOps (build, push and deploy a new Docker image)
uses: Staffbase/[email protected]
with:
docker-registry: ${{ inputs.docker-registry }}
docker-username: ${{ secrets.docker-username }}
docker-password: ${{ secrets.docker-password }}
docker-build-args: |
Expand All @@ -87,8 +108,13 @@ jobs:
docker-build-secrets: ${{ secrets.docker-build-secrets }}
docker-build-secret-files: ${{ secrets.docker-build-secret-files }}
docker-build-target: ${{ inputs.docker-build-target }}
docker-build-provenance: ${{ inputs.docker-build-provenance }}
docker-file: ${{ inputs.docker-file }}
docker-image: ${{ inputs.docker-image }}
gitops-organization: ${{ inputs.gitops-organization }}
gitops-repository: ${{ inputs.gitops-repository }}
gitops-user: ${{ inputs.gitops-user }}
gitops-email: ${{ inputs.gitops-email }}
gitops-token: ${{ env.USING_APP_CREDENTIALS == 'true' && steps.get_token.outputs.token || secrets.gitops-token }}
gitops-dev: ${{ inputs.gitops-dev }}
gitops-stage: ${{ inputs.gitops-stage }}
Expand Down
14 changes: 12 additions & 2 deletions README.md
flaxel marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,27 @@ jobs:
gitops:
uses: Staffbase/gha-workflows/.github/workflows/[email protected]
with:
# optional: host of the docker registry, default: "staffbase.jfrog.io"
docker-registry: "<your-registry>"
# optional: list of build-time variables
docker-build-args: |
"any important args"
# optional: set the target stage to build
docker-build-target: "any target"
# optional: set the provenance level of the docker build, default: "false"
docker-build-provenance: "<your-provenance-level>"
# optional: path to the Dockerfile, default: ./Dockerfile
docker-file: <path-to-Dockerfile>
# optional: name of the docker image, default: private/<repository_name>
docker-image: <your-image>
# optional: organization of the gitops repository, default: github.repository_owner
gitops-organization: <your-organization>
# optional: repository where to update the files, default: mops
gitops-repository: "<your-repository>"
# optional: user which does the commit, default: "Staffbot"
gitops-user: "<your-user>"
# optional: email of the user which does the commit, default: "[email protected]"
gitops-email: "<your-email>"
# optional: files which should be updated for dev
gitops-dev: |-
your files
Expand All @@ -136,8 +148,6 @@ jobs:
# optional: files which should be updated for prod
gitops-prod: |-
your files
# optional: organization of the gitops repository, default: github.repository_owner
gitops-organization: <your-organization>
secrets:
# optional: username for the docker registry
docker-username: ${{ <your-docker-username> }}
Expand Down
Loading