From 062150bbe577fd4f675832280c703f8400e4840f Mon Sep 17 00:00:00 2001 From: Peter Ovchyn Date: Thu, 21 Mar 2024 14:32:05 +0200 Subject: [PATCH] Add condition on restoring DB step --- .github/workflows/deploy_to_aws.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_to_aws.yml b/.github/workflows/deploy_to_aws.yml index 6c174d478..d1cb72338 100644 --- a/.github/workflows/deploy_to_aws.yml +++ b/.github/workflows/deploy_to_aws.yml @@ -27,6 +27,11 @@ on: required: false type: boolean default: false + restore-db: + description: 'Restore database' + required: false + type: boolean + default: false env: GITHUB_ENV_NAME: ${{ inputs.deploy-env || ((github.ref_name == 'main' || startsWith(github.ref_name, 'deploy-')) && 'Development') || (startsWith(github.ref_name, 'releases/') && 'Pre-prod') || 'None' }} @@ -241,7 +246,7 @@ jobs: needs: create_kafka_topic runs-on: ubuntu-latest environment: ${{ inputs.deploy-env || ((github.ref_name == 'main' || startsWith(github.ref_name, 'deploy-')) && 'Development') || (startsWith(github.ref_name, 'releases/') && 'Pre-prod') || 'None' }} - if: ${{ inputs.deploy-plan-only == false }} + if: ${{ inputs.deploy-plan-only == false }} steps: - name: Get Environment Name for ${{ vars.ENV_NAME }} id: get_env_name @@ -251,6 +256,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - name: Restore database for ${{ vars.ENV_NAME }} + if: ${{ vars.ENV_NAME != 'Production' && vars.ENV_NAME != 'Staging' && vars.ENV_NAME != 'Development' && inputs.restore-db == true}} run: | cd ./src/anon-tools docker build -t restore -f Dockerfile.restore .