Skip to content

PRE PROD Full - Deploy to Pre-Prod #64

PRE PROD Full - Deploy to Pre-Prod

PRE PROD Full - Deploy to Pre-Prod #64

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
mock_login_enabled:
description: "Do you want to deploy with mock login enabled?"
required: true
type: boolean
default: false
permissions:
actions: read # Required for anchore/sbom-action
contents: write # Required for anchore/sbom-action
pull-requests: write
id-token: write # This is required for requesting the JWT
jobs:
view_action_parameters:
name: View input params
runs-on: ubuntu-latest
steps:
- name: Display client passed variables
run: |
echo Build Branch: main
echo Sandbox: pre-prod
echo Environment: pre-prod
echo Cypress Base Url: ${{ vars.CYPRESS_BASE_URL }}
lambda_test_job:
name: Run Lambda Unit Tests
uses: ./.github/workflows/base-lambdas-reusable-test.yml
with:
python_version: "3.11"
build_branch: main
react_testing_job:
name: Run UI Unit Tests
uses: ./.github/workflows/base-vitest-test.yml
with:
build_branch: main
cypress_build_job:
name: Build UI version for E2E Tests
uses: ./.github/workflows/base-cypress-build.yml
with:
build_branch: main
cypress_test_job:
name: Run Cypress E2E Tests
needs: [cypress_build_job]
uses: ./.github/workflows/base-cypress-test-all-env.yml
with:
cypress_base_url: ${{ vars.CYPRESS_BASE_URL }}
build_branch: main
tag_and_release:
needs: ["lambda_test_job", "react_testing_job", "cypress_test_job"]
runs-on: ubuntu-latest
outputs:
version: ${{ steps.versioning.outputs.tag || github.event.inputs.branch_or_tag }}
permissions: write-all
steps:
- name: Checkout main
if: ${{ github.event.inputs.branch_or_tag == 'main' }}
uses: actions/checkout@v6
with:
ref: main
fetch-depth: '0'
- name: Bump version and push tag
if: ${{ github.event.inputs.branch_or_tag == 'main' }}
id: versioning
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch
- name: View outputs
run: |
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.version }}
sandbox: pre-prod
environment: pre-prod
python_version: "3.11"
secrets:
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
deploy_all_lambdas:
name: Deploy all Lambdas
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.version }}
sandbox: pre-prod
environment: pre-prod
python_version: "3.11"
mock_login_enabled: ${{ inputs.mock_login_enabled }}
secrets:
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
deploy_ui:
name: Deploy UI
needs: ["tag_and_release"]
uses: ./.github/workflows/base-deploy-ui.yml
with:
build_branch: ${{ needs.tag_and_release.outputs.version }}
environment: pre-prod
sandbox: pre-prod
secrets:
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}
deploy_data_collection:
name: Deploy ODS Data Collection
needs: ["tag_and_release"]
uses: ./.github/workflows/base-data-collection.yml
with:
build_branch: ${{ needs.tag_and_release.outputs.version }}
environment: pre-prod
sandbox: pre-prod
secrets:
AWS_ASSUME_ROLE: ${{ secrets.AWS_ASSUME_ROLE }}