Skip to content

SANDBOX Full- Deploy feature branch to sandbox #8

SANDBOX Full- Deploy feature branch to sandbox

SANDBOX Full- Deploy feature branch to sandbox #8

name: "PRE PROD Full- Deploy and Version Main to Pre-Prod"
on:
workflow_dispatch:
inputs:
build_branch:
description: "Feature branch to push to test?"
required: true
type: "string"
default: "main"
sandbox:
description: "Which Sandbox to push to."
required: true
type: "string"
default: "ndr"
environment:
description: "Which Environment settings to use."
required: true
type: "string"
default: "development"
permissions:
pull-requests: write
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
lambda_test_job:
name: Run Lambda Unit Tests
uses: ./.github/workflows/new_base-lambdas-reusable-test.yml
with:
environment: ${{ inputs.environment }}
python_version: "3.11"
build_branch: ${{ inputs.build_branch }}
react_testing_job:
name: Run UI Unit Tests
uses: ./.github/workflows/base-jest-test.yml
with:
build_branch: ${{ inputs.build_branch }}
cypress_build_job:
name: Build UI version for E2E Tests
uses: ./.github/workflows/base-cypress-build.yml
with:
build_branch: ${{ inputs.build_branch }}
cypress_test_job:
name: Run Cypress E2E Tests
needs: [cypress_build_job]
uses: ./.github/workflows/base-cypress-test-all-env.yml
with:
build_branch: ${{ inputs.build_branch }}
environment: ${{ inputs.environment }}
# tag_and_release:
# needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"]
# runs-on: ubuntu-latest
# environment: pre-prod
# outputs:
# tag: ${{steps.versioning.outputs.tag}}
# new_tag: ${{steps.versioning.outputs.new_tag}}
# defaults:
# run:
# working-directory: ./lambdas
# permissions: write-all
# steps:
# - uses: actions/checkout@v3
# with:
# ref: ${{ env.BUILD_BRANCH }}
# fetch-depth: '0'
# - name: Bump version and push tag
# id: versioning
# uses: anothrNick/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# WITH_V: false
# DEFAULT_BUMP: patch
# - name: View outputs
# run: |
# echo Current tag: ${{steps.versioning.outputs.tag}}
# echo New tag: ${{steps.versioning.outputs.new_tag}}
deploy_all_lambdas:
name: Deploy all Lambdas
needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"]
uses: ./.github/workflows/new_lambdas-deploy-feature-to-sandbox.yml
with:
build_branch: ${{ inputs.build_branch }}
sandbox: ${{ inputs.sandbox }}
environment: ${{ inputs.environment }}
secrets:
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
deploy_ui:
name: Deploy UI
needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"]
uses: ./.github/workflows/base-deploy-ui.yml
with:
build_branch: ${{ inputs.build_branch }}
aws_region: ${{ vars.AWS_REGION }}
build_env: ${{ vars.BUILD_ENV }}
secrets:
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
AWS_ECR_REPO_NAME: ${{ secrets.AWS_ECR_REPO_NAME }}