diff --git a/.github/workflows/reusable.environment.yml b/.github/workflows/reusable.environment.yml index 4c885c9..1485a13 100644 --- a/.github/workflows/reusable.environment.yml +++ b/.github/workflows/reusable.environment.yml @@ -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 @@ -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 diff --git a/.github/workflows/scicat-be.yml b/.github/workflows/scicat-be.yml index 236d7d2..43e4ab0 100644 --- a/.github/workflows/scicat-be.yml +++ b/.github/workflows/scicat-be.yml @@ -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: @@ -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