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 option to choose deployment env on dispatch #245

Merged
merged 1 commit into from
Oct 14, 2024
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
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
Loading