Skip to content

Commit

Permalink
Add option to choose deployment env on dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Oct 14, 2024
1 parent c3e3c84 commit 6095ccd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/reusable.environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
description: commit of the CI repo to deploy on workflow dispatch
required: false
type: string
environment:
description: environment to deploy to
required: false
type: string
outputs:
tag:
description: tag of the docker image
Expand Down Expand Up @@ -46,7 +50,8 @@ jobs:
commit=${input_commit:-${{ github.sha }}}
submodule_append=`[ -z ${{ inputs.submodule_commit }} ] || echo "_sha-${{ inputs.submodule_commit }}" && echo ""`
tag="sha-$commit$submodule_append"
environment=development
env=${{ inputs.environment }}
environment=${env:-development}
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
tag="sha-${{ github.sha }}"
environment=qa
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/scicat-be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ on:
commit:
description: 'Commit of the CI repo to deploy'
required: false
environment:
description: 'Environment to deploy to'
type: choice
default: 'development'
options:
- development
- qa
pull_request:
branches: [ main ]
push:
Expand All @@ -23,6 +30,7 @@ jobs:
with:
commit: ${{ github.event.inputs.commit }}
submodule_commit: ${{ github.event.inputs.submodule_commit }}
environment: ${{ github.event.inputs.environment }}

check_changed:
needs: set_env
Expand Down

0 comments on commit 6095ccd

Please sign in to comment.