diff --git a/.github/workflows/full-deploy-to-pre-prod.yml b/.github/workflows/full-deploy-to-pre-prod.yml index 2c4cbf090..3b4015c1c 100644 --- a/.github/workflows/full-deploy-to-pre-prod.yml +++ b/.github/workflows/full-deploy-to-pre-prod.yml @@ -1,7 +1,13 @@ -name: "PRE PROD Full - Deploy and Version Main to Pre-Prod" +name: "PRE PROD Full - Deploy to Pre-Prod" on: workflow_dispatch: + inputs: + branch_or_tag: + description: "Which branch or tag do you want to deploy to pre-prod?" + required: true + type: string + default: main permissions: pull-requests: write @@ -12,8 +18,7 @@ jobs: view_action_parameters: name: View input params runs-on: ubuntu-latest - steps: - + steps: - name: Display client passed variables run: | echo Build Branch: main @@ -52,17 +57,19 @@ jobs: needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"] runs-on: ubuntu-latest outputs: - tag: ${{steps.versioning.outputs.tag}} - new_tag: ${{steps.versioning.outputs.new_tag}} + version: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} permissions: write-all steps: - - uses: actions/checkout@v4 + - name: Checkout main + if: ${{ github.event.inputs.branch_or_tag == 'main' }} + uses: actions/checkout@v4 with: ref: main fetch-depth: '0' - name: Bump version and push tag + if: ${{ github.event.inputs.branch_or_tag == 'main' }} id: versioning uses: anothrNick/github-tag-action@1.64.0 env: @@ -72,15 +79,14 @@ jobs: - name: View outputs run: | - echo Current tag: ${{steps.versioning.outputs.tag}} - echo New tag: ${{steps.versioning.outputs.new_tag}} + echo Deploying branch or tagged version to pre-prod: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} publish_all_lambda_layers: name: Publish all Lambda Layers needs: ["tag_and_release"] uses: ./.github/workflows/base-lambda-layer-reusable-publish-all.yml with: - build_branch: ${{ needs.tag_and_release.outputs.tag }} + build_branch: ${{ needs.tag_and_release.outputs.version }} sandbox: pre-prod environment: pre-prod python_version: "3.11" @@ -92,7 +98,7 @@ jobs: needs: ["tag_and_release", "publish_all_lambda_layers"] uses: ./.github/workflows/base-lambdas-reusable-deploy-all.yml with: - build_branch: ${{ needs.tag_and_release.outputs.tag }} + build_branch: ${{ needs.tag_and_release.outputs.version }} sandbox: pre-prod environment: pre-prod python_version: "3.11" @@ -104,7 +110,7 @@ jobs: needs: ["tag_and_release"] uses: ./.github/workflows/base-deploy-ui.yml with: - build_branch: ${{ needs.tag_and_release.outputs.tag }} + build_branch: ${{ needs.tag_and_release.outputs.version }} environment: pre-prod sandbox: pre-prod secrets: @@ -115,12 +121,9 @@ jobs: needs: ["tag_and_release"] uses: ./.github/workflows/base-batch-update.yml with: - build_branch: ${{ needs.tag_and_release.outputs.tag }} + build_branch: ${{ needs.tag_and_release.outputs.version }} environment: pre-prod sandbox: pre-prod secrets: AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }} - - - \ No newline at end of file diff --git a/.github/workflows/lambdas-deploy-to-pre-prod.yml b/.github/workflows/lambdas-deploy-to-pre-prod.yml index c56c7e416..033cc2b79 100644 --- a/.github/workflows/lambdas-deploy-to-pre-prod.yml +++ b/.github/workflows/lambdas-deploy-to-pre-prod.yml @@ -1,7 +1,13 @@ -name: "PRE PROD Lambdas - Deploy and Version Main to Pre-Prod" +name: "PRE PROD Lambdas - Deploy to Pre-Prod" on: workflow_dispatch: + inputs: + branch_or_tag: + description: "Which branch or tag do you want to deploy to pre-prod?" + required: true + type: string + default: main permissions: pull-requests: write @@ -20,20 +26,22 @@ jobs: runs-on: ubuntu-latest environment: pre-prod outputs: - tag: ${{steps.versioning.outputs.tag}} - new_tag: ${{steps.versioning.outputs.new_tag}} + version: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} defaults: run: working-directory: ./lambdas permissions: write-all steps: - - uses: actions/checkout@v4 + - name: Checkout main + if: ${{ github.event.inputs.branch_or_tag == 'main' }} + uses: actions/checkout@v4 with: - ref: ${{ env.BUILD_BRANCH }} + ref: main fetch-depth: '0' - name: Bump version and push tag + if: ${{ github.event.inputs.branch_or_tag == 'main' }} id: versioning uses: anothrNick/github-tag-action@1.64.0 env: @@ -43,20 +51,16 @@ jobs: - name: View outputs run: | - echo Current tag: ${{steps.versioning.outputs.tag}} - echo New tag: ${{steps.versioning.outputs.new_tag}} + echo Deploying branch or tagged version to pre-prod lambdas: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} deploy_all: name: Deploy all Lambdas needs: ["run_tests", "tag_and_release"] uses: ./.github/workflows/lambdas-deploy-feature-to-sandbox.yml with: - build_branch: ${{ needs.tag_and_release.outputs.tag }} + build_branch: ${{ needs.tag_and_release.outputs.version }} sandbox: pre-prod environment: pre-prod secrets: AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }} - - - \ No newline at end of file diff --git a/.github/workflows/ui-deploy-to-pre-prod-manual.yml b/.github/workflows/ui-deploy-to-pre-prod-manual.yml index 829382a8c..c5baf2c20 100644 --- a/.github/workflows/ui-deploy-to-pre-prod-manual.yml +++ b/.github/workflows/ui-deploy-to-pre-prod-manual.yml @@ -1,7 +1,13 @@ -name: 'PRE PROD UI - Deploy and Version Main to Pre-Prod' +name: 'PRE PROD UI - Deploy to Pre-Prod' on: workflow_dispatch: + inputs: + branch_or_tag: + description: "Which branch or tag do you want to deploy to pre-prod?" + required: true + type: string + default: main permissions: pull-requests: write @@ -9,7 +15,6 @@ permissions: contents: read # This is required for actions/checkout jobs: - react_testing_job: name: Run UI Unit Tests uses: ./.github/workflows/base-jest-test.yml @@ -31,20 +36,22 @@ jobs: build_branch: main tag_and_release: - needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"] + needs: ["react_testing_job", "cypress_test_job"] runs-on: ubuntu-latest outputs: - tag: ${{steps.versioning.outputs.tag}} - new_tag: ${{steps.versioning.outputs.new_tag}} + version: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} permissions: write-all steps: - - uses: actions/checkout@v4 + - name: Checkout main + if: ${{ github.event.inputs.branch_or_tag == 'main' }} + uses: actions/checkout@v4 with: ref: main fetch-depth: '0' - name: Bump version and push tag + if: ${{ github.event.inputs.branch_or_tag == 'main' }} id: versioning uses: anothrNick/github-tag-action@1.64.0 env: @@ -54,16 +61,15 @@ jobs: - name: View outputs run: | - echo Current tag: ${{steps.versioning.outputs.tag}} - echo New tag: ${{steps.versioning.outputs.new_tag}} + echo Deploying branch or tagged version to pre-prod UI: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }} deploy_ui: name: Deploy UI needs: ["tag_and_release"] uses: ./.github/workflows/base-deploy-ui.yml with: - build_branch: ${{ needs.tag_and_release.outputs.tag }} + build_branch: ${{ needs.tag_and_release.outputs.version }} environment: pre-prod sandbox: pre-prod secrets: - AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }} \ No newline at end of file + AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}