diff --git a/.github/actions/build-and-push/action.yml b/.github/actions/build-and-push/action.yml
new file mode 100644
index 00000000000..7739c7304d5
--- /dev/null
+++ b/.github/actions/build-and-push/action.yml
@@ -0,0 +1,25 @@
+name: Build and Push
+description: Build and push Docker image to the registry
+inputs:
+ acr_registry:
+ description: Azure Container Registry to push the image to
+ required: true
+ acr_username:
+ description: Azure Container Registry username
+ required: true
+ acr_password:
+ description: Azure Container Registry password
+ required: true
+
+runs:
+ using: composite
+ steps:
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v2
+ - name: Login to ACR
+ shell: bash
+ run: docker login ${{ inputs.acr_registry }} -u ${{ inputs.acr_username }} -p ${{ inputs.acr_password }}
+ - name: Build and push Docker images
+ working-directory: ./backend
+ shell: bash
+ run: ./build_and_push.sh
diff --git a/.github/actions/build-frontend/action.yml b/.github/actions/build-frontend/action.yml
index 4ec7857fceb..33f2088fd19 100644
--- a/.github/actions/build-frontend/action.yml
+++ b/.github/actions/build-frontend/action.yml
@@ -1,33 +1,48 @@
name: Build SimpleReport Front End
description: Build the React application
inputs:
- deploy-env:
+ deploy_env:
description: The environment being deployed (e.g. "prod" or "test")
required: true
- smarty-streets-key:
+ smarty_streets_key:
description: The Smarty-Streets API token for this environment. (Should be fetched from vault but is not)
required: true
- base-domain-name:
+ base_domain_name:
description: The domain where the application is deployed (e.g. "simplereport.gov" or "test.simplereport.gov")
required: false
- client-tarball:
+ client_tarball:
description: The path to the tar file containing the client code to deploy
required: true
- is-training-site:
+ is_training_site:
description: If this is set, special training branding will be applied.
required: false
- okta-enabled:
+ okta_enabled:
description: If this is set, the app will redirect to Okta if no one is logged in.
required: true
- okta-url:
+ okta_url:
description: The Okta instance to redirect to.
required: false
- okta-client-id:
+ okta_client_id:
description: The Okta client ID for this environment.
required: false
+ azure_creds:
+ description: The Azure credentials for this environment.
+ required: true
runs:
using: composite
steps:
+ - uses: actions/setup-node@v3.8.1
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+ - name: Use cache for node_modules
+ uses: actions/cache@v3.3.2
+ with:
+ path: |
+ ./frontend/node_modules
+ key: npm-${{ env.NODE_VERSION }}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
+ - uses: azure/login@v1
+ with:
+ creds: ${{ inputs.azure_creds }}
- name: Install dependencies
working-directory: ./frontend
shell: bash
@@ -40,34 +55,34 @@ runs:
working-directory: ./frontend
run: |
echo "::group::Set build variables"
- ENVLVL=${{inputs.deploy-env}}
+ ENVLVL=${{ inputs.deploy_env }}
ENVLVL=${ENVLVL//[[:digit:]]/}
echo "Environment level: $ENVLVL"
az config set extension.use_dynamic_install=yes_without_prompt
INSIGHTS_CONNECTION_STRING=$(
az monitor app-insights component show \
-g prime-simple-report-$ENVLVL \
- -a prime-simple-report-${{inputs.deploy-env}}-insights \
+ -a prime-simple-report-${{ inputs.deploy_env }}-insights \
| jq -r '.connectionString')
echo "REACT_APP_APPLICATIONINSIGHTS_CONNECTION_STRING=${INSIGHTS_CONNECTION_STRING}" > .env.production.local
- if [[ -n "${{ inputs.base-domain-name }}" ]]
- then echo "REACT_APP_BASE_URL=https://${{inputs.base-domain-name}}" >> .env.production.local
+ if [[ -n "${{ inputs.base_domain_name }}" ]]
+ then echo "REACT_APP_BASE_URL=https://${{ inputs.base_domain_name }}" >> .env.production.local
fi
- if [[ "true" == "${{ inputs.is-training-site }}" ]]
+ if [[ "true" == "${{ inputs.is_training_site }}" ]]
then echo "REACT_APP_IS_TRAINING_SITE=true" >> .env.production.local
fi
- if [[ "true" == "${{ inputs.okta-enabled }}" ]]; then
+ if [[ "true" == "${{ inputs.okta_enabled }}" ]]; then
echo "REACT_APP_OKTA_ENABLED=true" >> .env.production.local
- echo "REACT_APP_OKTA_URL=${{inputs.okta-url}}" >> .env.production.local
- echo "REACT_APP_OKTA_CLIENT_ID=${{inputs.okta-client-id}}" >> .env.production.local
+ echo "REACT_APP_OKTA_URL=${{ inputs.okta_url }}" >> .env.production.local
+ echo "REACT_APP_OKTA_CLIENT_ID=${{ inputs.okta_client_id }}" >> .env.production.local
fi
echo "::endgroup::"
- name: Build deployable application
shell: bash
working-directory: ./frontend
env:
- REACT_APP_SMARTY_STREETS_KEY: ${{ inputs.smarty-streets-key }}
- DEPLOY_ENV: ${{ inputs.deploy-env }}
+ REACT_APP_SMARTY_STREETS_KEY: ${{ inputs.smarty_streets_key }}
+ DEPLOY_ENV: ${{ inputs.deploy_env }}
run: |
echo "::group::Build application"
yarn run build
@@ -76,5 +91,12 @@ runs:
shell: bash
run: |
echo "::group::Create application archive"
- tar -C ./frontend/build -czf ${{inputs.client-tarball}} .
+ tar -C ./frontend/build -czf ${{ inputs.client_tarball }} .
echo "::endgroup::"
+ - name: Save compiled frontend application
+ uses: actions/upload-artifact@v3
+ if: success()
+ with:
+ name: frontend-tarball
+ path: client.tgz
+ retention-days: 1
diff --git a/.github/actions/deploy-application/action.yml b/.github/actions/deploy-application/action.yml
index 4105686a2d0..db5249b596b 100644
--- a/.github/actions/deploy-application/action.yml
+++ b/.github/actions/deploy-application/action.yml
@@ -1,28 +1,39 @@
name: Deploy SimpleReport Application
description: Promote API from secondary slot, and deploy client from tarball
inputs:
- deploy-env:
+ deploy_env:
description: The environment being deployed (e.g. "prod" or "test")
required: true
- client-tarball:
+ client_tarball:
description: The path to the tar file containing the client code to deploy
required: true
+ azure_creds:
+ description: The Azure credentials for this environment.
+ required: true
+
runs:
using: composite
steps:
+ - uses: azure/login@v1
+ with:
+ creds: ${{ inputs.azure_creds }}
+ - name: Retrieve frontend build
+ uses: actions/download-artifact@v3
+ with:
+ name: frontend-tarball
- name: Unpack client
shell: bash
run: |
echo "::group::Unpack client"
mkdir client-build;
- tar -C client-build -zxvf ${{inputs.client-tarball}}
+ tar -C client-build -zxvf ${{ inputs.client_tarball }}
echo "::endgroup::"
- name: Promote API to production and verify that it is ready
shell: bash
working-directory: ./ops
run: |
echo "::group::Promote API and verify readiness"
- make promote-${{ env.DEPLOY_ENV }} check-${{ env.DEPLOY_ENV }}-readiness
+ make promote-${{ inputs.deploy_env }} check-${{ inputs.deploy_env }}-readiness
echo "::endgroup::"
- name: Check for production app readiness
shell: bash
@@ -33,7 +44,7 @@ runs:
run: |
echo "::group::Deploy frontend app"
az storage blob upload-batch -s client-build/ -d '$web' \
- --account-name simplereport${{ inputs.deploy-env }}app \
+ --account-name simplereport${{ inputs.deploy_env }}app \
--destination-path '/app' \
--overwrite
echo "::endgroup::"
diff --git a/.github/actions/build-docker-image/action.yml b/.github/actions/docker-buildx/action.yml
similarity index 84%
rename from .github/actions/build-docker-image/action.yml
rename to .github/actions/docker-buildx/action.yml
index a7b56703da6..054927b8e7d 100644
--- a/.github/actions/build-docker-image/action.yml
+++ b/.github/actions/docker-buildx/action.yml
@@ -1,27 +1,20 @@
name: Build Docker Image
description: Build and push Docker image to the registry
inputs:
- acr_registry:
- description: Azure Container Registry to push the image to
- required: true
- acr_username:
- description: Azure Container Registry username
- required: true
- acr_password:
- description: Azure Container Registry password
- required: true
build_args:
description: Build arguments to pass to the Docker build
required: false
context:
description: Path to the build context
- required: true
+ required: false
+ default: ./
file:
description: Path to the Dockerfile
required: true
gh_registry:
description: Registry to push the image to
- required: true
+ required: false
+ default: ghcr.io
gh_username:
description: Github username
required: true
@@ -33,10 +26,8 @@ inputs:
required: true
platform:
description: Platform to build the image for
- required: true
- version_tag:
- description: Version tag to use for the image
required: false
+ default: linux/amd64
outputs:
version:
description: Version of the image that was built
diff --git a/.github/actions/stg-wait-for-slot-commit/action.yml b/.github/actions/stg-wait-for-slot-commit/action.yml
new file mode 100644
index 00000000000..5c6a1b92976
--- /dev/null
+++ b/.github/actions/stg-wait-for-slot-commit/action.yml
@@ -0,0 +1,14 @@
+name: Terraform Action wait for slot commit
+description: Build and push Docker image to the registry
+inputs:
+ deploy_env:
+ description: The environment to deploy to
+ required: true
+
+runs:
+ using: composite
+ steps:
+ - name: Wait for correct commit to be deployed in staging slot
+ working-directory: ./ops
+ shell: bash
+ run: make wait-for-${{ inputs.deploy_env }}-slot-commit
diff --git a/.github/actions/stg-wait-for-slot-readiness/action.yml b/.github/actions/stg-wait-for-slot-readiness/action.yml
new file mode 100644
index 00000000000..22cfbd4a542
--- /dev/null
+++ b/.github/actions/stg-wait-for-slot-readiness/action.yml
@@ -0,0 +1,14 @@
+name: Terraform Action wait for slot readiness
+description: Build and push Docker image to the registry
+inputs:
+ deploy_env:
+ description: The environment to deploy to
+ required: true
+
+runs:
+ using: composite
+ steps:
+ - name: Wait for staging deploy to be ready
+ working-directory: ./ops
+ shell: bash
+ run: make wait-for-${{ inputs.deploy_env }}-slot-readiness
diff --git a/.github/actions/tf-deploy/action.yml b/.github/actions/tf-deploy/action.yml
new file mode 100644
index 00000000000..a3a8555be12
--- /dev/null
+++ b/.github/actions/tf-deploy/action.yml
@@ -0,0 +1,58 @@
+name: Terraform Action Deployment
+description: Build and push Docker image to the registry
+inputs:
+ azure_creds:
+ description: Azure credentials
+ required: true
+ deploy_env:
+ description: The environment to deploy to
+ required: true
+ terraform_arm_client_id:
+ description: Terraform ARM client ID
+ required: true
+ terraform_arm_client_secret:
+ description: Terraform ARM client secret
+ required: true
+ terraform_arm_subscription_id:
+ description: Terraform ARM subscription ID
+ required: true
+ terraform_arm_tenant_id:
+ description: Terraform ARM tenant ID
+ required: true
+ okta_api_token:
+ description: Okta API token
+ required: true
+
+runs:
+ using: composite
+ steps:
+ - uses: azure/login@v1
+ with:
+ creds: ${{ inputs.azure_creds }}
+ - uses: hashicorp/setup-terraform@v2.0.3
+ with:
+ terraform_version: 1.3.3
+ - name: Build ReportStream function app
+ uses: ./.github/actions/build-reportstream-functions
+ with:
+ deploy-env: ${{ inputs.deploy_env }}
+ - name: Terraform Init
+ working-directory: ./ops
+ env: # all Azure interaction is through Terraform
+ ARM_CLIENT_ID: ${{ inputs.terraform_arm_client_id }}
+ ARM_CLIENT_SECRET: ${{ inputs.terraform_arm_client_secret }}
+ ARM_SUBSCRIPTION_ID: ${{ inputs.terraform_arm_subscription_id }}
+ ARM_TENANT_ID: ${{ inputs.terraform_arm_tenant_id }}
+ OKTA_API_TOKEN: ${{ inputs.okta_api_token }}
+ shell: bash
+ run: make init-${{ inputs.deploy_env }}
+ - name: Terraform deploy (infrastructure and staging slot)
+ working-directory: ./ops
+ env: # all Azure interaction is through Terraform
+ ARM_CLIENT_ID: ${{ inputs.terraform_arm_client_id }}
+ ARM_CLIENT_SECRET: ${{ inputs.terraform_arm_client_secret }}
+ ARM_SUBSCRIPTION_ID: ${{ inputs.terraform_arm_subscription_id }}
+ ARM_TENANT_ID: ${{ inputs.terraform_arm_tenant_id }}
+ OKTA_API_TOKEN: ${{ inputs.okta_api_token }}
+ shell: bash
+ run: make deploy-${{ inputs.deploy_env }}
diff --git a/.github/workflows/deployDemo.yml b/.github/workflows/deployDemo.yml
index 0ffdc7e7143..053cf304e9c 100644
--- a/.github/workflows/deployDemo.yml
+++ b/.github/workflows/deployDemo.yml
@@ -9,108 +9,77 @@ on:
env:
DEPLOY_ENV: demo
NODE_VERSION: 18
+
concurrency:
group: demo-deploy
cancel-in-progress: false
jobs:
build_docker:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
steps:
- uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ - name: Build and Push backend
+ uses: ./.github/actions/build-and-push
+ with:
+ acr_registry: ${{ secrets.ACR_REPO_URL }}
+ acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
+ acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
+
+ build_frontend:
runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
+ - uses: ./.github/actions/build-frontend
+ name: Build front-end application
with:
- terraform_version: 1.3.3
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: ./client.tgz
+ deploy_env: ${{env.DEPLOY_ENV}}
+ smarty_streets_key: ${{ secrets.SMARTY_STREETS_KEY }}
+ okta_enabled: false
+
+ prerelease_backend:
runs-on: ubuntu-latest
+ needs: [build_frontend, build_docker]
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
+ - uses: ./.github/actions/tf-deploy
+ name: Deploy with Terraform
with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ terraform_arm_client_id: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
+ terraform_arm_client_secret: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
+ terraform_arm_subscription_id: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
+ terraform_arm_tenant_id: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
+ okta_api_token: ${{ secrets.OKTA_API_TOKEN }}
+ - uses: ./.github/actions/stg-wait-for-slot-commit
+ name: Wait for correct commit to be deployed in staging slot
+ timeout-minutes: 5
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: false
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ - uses: ./.github/actions/stg-wait-for-slot-readiness
+ name: Wait for staging deploy to be ready
+ timeout-minutes: 1
with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
deploy:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment:
- name: Demo
- url: https://demo.simplereport.gov
+ name: ${{ env.DEPLOY_ENV }}
+ url: https://${{ env.DEPLOY_ENV }}.simplereport.gov
needs: [prerelease_backend]
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- name: Promote and deploy
uses: ./.github/actions/deploy-application
with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: client.tgz
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
slack_alert:
runs-on: ubuntu-latest
if: failure()
diff --git a/.github/workflows/deployDev.yml b/.github/workflows/deployDev.yml
index 776707d9ac3..6e7ead82146 100644
--- a/.github/workflows/deployDev.yml
+++ b/.github/workflows/deployDev.yml
@@ -1,120 +1,96 @@
name: Deploy Dev
+run-name: Deploy to ${{ inputs.deploy_env }} by @${{ github.actor }}
on:
workflow_dispatch:
+ inputs:
+ deploy_env:
+ description: 'The environment to deploy to'
+ required: true
+ type: choice
+ options:
+ - ""
+ - dev
+ - dev2
+ - dev3
+ - dev4
+ - dev5
+ - dev6
+ - dev7
+ - pentest
env:
- DEPLOY_ENV: dev
NODE_VERSION: 18
concurrency:
- group: dev-deploy
+ group: ${{ github.event.inputs.deploy_env }}-deploy
cancel-in-progress: false
jobs:
build_docker:
runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
steps:
- uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
+ - name: Build and Push backend
+ uses: ./.github/actions/build-and-push
+ with:
+ acr_registry: ${{ secrets.ACR_REPO_URL }}
+ acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
+ acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
+
+ build_frontend:
runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through Terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
+ environment: ${{ inputs.deploy_env }}
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
+ - uses: ./.github/actions/build-frontend
+ name: Build front-end application
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: ./client.tgz
+ deploy_env: ${{ inputs.deploy_env }}
+ smarty_streets_key: ${{ secrets.SMARTY_STREETS_KEY }}
+ okta_enabled: true
+ okta_url: https://hhs-prime.oktapreview.com
+ okta_client_id: ${{ vars.OKTA_CLIENT_ID }}
+
+ prerelease_backend:
runs-on: ubuntu-latest
+ needs: [build_frontend, build_docker]
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
+ - uses: ./.github/actions/tf-deploy
+ name: Deploy with Terraform
with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ deploy_env: ${{ inputs.deploy_env }}
+ terraform_arm_client_id: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
+ terraform_arm_client_secret: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
+ terraform_arm_subscription_id: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
+ terraform_arm_tenant_id: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
+ okta_api_token: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
+ - uses: ./.github/actions/stg-wait-for-slot-commit
+ name: Wait for correct commit to be deployed in staging slot
+ timeout-minutes: 5
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa1khbp5n2wTfe281d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
+ deploy_env: ${{ inputs.deploy_env }}
+ - uses: ./.github/actions/stg-wait-for-slot-readiness
+ name: Wait for staging deploy to be ready
+ timeout-minutes: 1
with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
+ deploy_env: ${{ inputs.deploy_env }}
+
deploy:
runs-on: ubuntu-latest
environment:
- name: Dev
- url: https://dev.simplereport.gov
+ name: ${{ inputs.deploy_env }}
+ url: https://${{ inputs.deploy_env }}.simplereport.gov
needs: [prerelease_backend]
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- name: Promote and deploy
uses: ./.github/actions/deploy-application
with:
- client-tarball: client.tgz
- deploy-env: ${{ env.DEPLOY_ENV }}
- - name: Sendgrid maintenance banner deploy
- uses: ./.github/actions/maintenance-banner-deploy
- with:
- active: "true"
- header: "Dev Notice:"
- message: "This environment has email delivery enabled. Do not use real email addresses."
- env: ${{ env.DEPLOY_ENV }}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: client.tgz
+ deploy_env: ${{ inputs.deploy_env }}
diff --git a/.github/workflows/deployDev2.yml b/.github/workflows/deployDev2.yml
deleted file mode 100644
index 0d5c4d1b14f..00000000000
--- a/.github/workflows/deployDev2.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-name: Deploy Dev2
-
-on:
- workflow_dispatch:
-
-env:
- DEPLOY_ENV: dev2
- NODE_VERSION: 18
-concurrency:
- group: dev2-deploy
- cancel-in-progress: false
-
-jobs:
- build_docker:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
- steps:
- - uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through Terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
- with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa3ii5dwmasAsCww1d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
- with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
- deploy:
- runs-on: ubuntu-latest
- environment:
- name: Dev2
- url: https://${{env.DEPLOY_ENV}}.simplereport.gov
- needs: [prerelease_backend]
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- - name: Promote and deploy
- uses: ./.github/actions/deploy-application
- with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
diff --git a/.github/workflows/deployDev3.yml b/.github/workflows/deployDev3.yml
deleted file mode 100644
index 693308ca77c..00000000000
--- a/.github/workflows/deployDev3.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-name: Deploy Dev3
-
-on:
- workflow_dispatch:
-
-env:
- DEPLOY_ENV: dev3
- NODE_VERSION: 18
-concurrency:
- group: dev3-deploy
- cancel-in-progress: false
-
-jobs:
- build_docker:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
- steps:
- - uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through Terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
- with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa3ivrvd9Jhvt8Sb1d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
- with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
- deploy:
- runs-on: ubuntu-latest
- environment:
- name: Dev3
- url: https://${{env.DEPLOY_ENV}}.simplereport.gov
- needs: [prerelease_backend]
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- - name: Promote and deploy
- uses: ./.github/actions/deploy-application
- with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
diff --git a/.github/workflows/deployDev4.yml b/.github/workflows/deployDev4.yml
deleted file mode 100644
index cd9273b2e58..00000000000
--- a/.github/workflows/deployDev4.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-name: Deploy Dev4
-
-on:
- workflow_dispatch:
-
-env:
- DEPLOY_ENV: dev4
- NODE_VERSION: 18
-concurrency:
- group: dev4-deploy
- cancel-in-progress: false
-
-jobs:
- build_docker:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
- steps:
- - uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through Terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
- with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa3j1kbqp4ip5Osz1d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
- with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
- deploy:
- runs-on: ubuntu-latest
- environment:
- name: Dev4
- url: https://${{env.DEPLOY_ENV}}.simplereport.gov
- needs: [prerelease_backend]
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- - name: Promote and deploy
- uses: ./.github/actions/deploy-application
- with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
diff --git a/.github/workflows/deployDev5.yml b/.github/workflows/deployDev5.yml
deleted file mode 100644
index 94f0faed0c7..00000000000
--- a/.github/workflows/deployDev5.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-name: Deploy Dev5
-
-on:
- workflow_dispatch:
-
-env:
- DEPLOY_ENV: dev5
- NODE_VERSION: 18
-concurrency:
- group: dev5-deploy
- cancel-in-progress: false
-
-jobs:
- build_docker:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
- steps:
- - uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through Terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
- with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa5utork4AEiKyO71d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
- with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
- deploy:
- runs-on: ubuntu-latest
- environment:
- name: Dev5
- url: https://${{env.DEPLOY_ENV}}.simplereport.gov
- needs: [prerelease_backend]
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- - name: Promote and deploy
- uses: ./.github/actions/deploy-application
- with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
diff --git a/.github/workflows/deployDev6.yml b/.github/workflows/deployDev6.yml
deleted file mode 100644
index f83863a1a9a..00000000000
--- a/.github/workflows/deployDev6.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-name: Deploy Dev6
-
-on:
- workflow_dispatch:
-
-env:
- DEPLOY_ENV: dev6
- NODE_VERSION: 18
-concurrency:
- group: dev6-deploy
- cancel-in-progress: false
-
-jobs:
- build_docker:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
- steps:
- - uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through Terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
- with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa5uvg0531PLkxNP1d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
- with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
- deploy:
- runs-on: ubuntu-latest
- environment:
- name: dev6
- url: https://${{env.DEPLOY_ENV}}.simplereport.gov
- needs: [prerelease_backend]
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- - name: Promote and deploy
- uses: ./.github/actions/deploy-application
- with:
- client-tarball: client.tgz
- deploy-env: ${{ env.DEPLOY_ENV }}
diff --git a/.github/workflows/deployDev7.yml b/.github/workflows/deployDev7.yml
deleted file mode 100644
index c13a22ce57a..00000000000
--- a/.github/workflows/deployDev7.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-name: Deploy Dev7
-
-on:
- workflow_dispatch:
-
-env:
- DEPLOY_ENV: dev7
- NODE_VERSION: 18
-concurrency:
- group: dev7-deploy
- cancel-in-progress: false
-
-jobs:
- build_docker:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
- steps:
- - uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through Terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
- with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa5uvpmofBA83yGZ1d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
- with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
- deploy:
- runs-on: ubuntu-latest
- environment:
- name: dev7
- url: https://${{env.DEPLOY_ENV}}.simplereport.gov
- needs: [prerelease_backend]
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- - name: Promote and deploy
- uses: ./.github/actions/deploy-application
- with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
diff --git a/.github/workflows/deployPentest.yml b/.github/workflows/deployPentest.yml
deleted file mode 100644
index e3d6690292d..00000000000
--- a/.github/workflows/deployPentest.yml
+++ /dev/null
@@ -1,108 +0,0 @@
-name: Deploy Pentest
-
-on:
- workflow_dispatch:
-
-env:
- DEPLOY_ENV: pentest
- NODE_VERSION: 18
-concurrency:
- group: pentest-deploy
- cancel-in-progress: false
-
-jobs:
- build_docker:
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
- steps:
- - uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
- with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
- with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa1hwvzb4X0sgGAt1d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
- with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
- deploy:
- runs-on: ubuntu-latest
- environment:
- name: Pentest
- url: https://pentest.simplereport.gov
- needs: [prerelease_backend]
- steps:
- - uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- - name: Promote and deploy
- uses: ./.github/actions/deploy-application
- with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
diff --git a/.github/workflows/deployProd.yml b/.github/workflows/deployProd.yml
index 458ddcc3e7d..d703f939ddc 100644
--- a/.github/workflows/deployProd.yml
+++ b/.github/workflows/deployProd.yml
@@ -9,98 +9,65 @@ on:
env:
DEPLOY_ENV: prod
NODE_VERSION: 18
+
concurrency:
group: prod-deploy
cancel-in-progress: false
jobs:
build_docker:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
steps:
- uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ - name: Build and Push backend
+ uses: ./.github/actions/build-and-push
+ with:
+ acr_registry: ${{ secrets.ACR_REPO_URL }}
+ acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
+ acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
+
+ build_frontend:
runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
+ - uses: ./.github/actions/build-frontend
+ name: Build front-end application
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct release to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: ./client.tgz
+ deploy_env: ${{env.DEPLOY_ENV}}
+ smarty_streets_key: ${{ secrets.SMARTY_STREETS_KEY }}
+ okta_enabled: true
+ okta_url: https://hhs-prime.okta.com
+ okta_client_id: 0oa5ahrdfSpxmNZO74h6
+
+ prerelease_backend:
runs-on: ubuntu-latest
- outputs:
- download-url: ${{steps.upload.outputs.url}}
+ needs: [build_frontend, build_docker]
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
+ - uses: ./.github/actions/tf-deploy
+ name: Deploy with Terraform
with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ terraform_arm_client_id: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
+ terraform_arm_client_secret: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
+ terraform_arm_subscription_id: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
+ terraform_arm_tenant_id: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
+ okta_api_token: ${{ secrets.OKTA_API_TOKEN }}
+ - uses: ./.github/actions/stg-wait-for-slot-commit
+ name: Wait for correct commit to be deployed in staging slot
+ timeout-minutes: 5
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- base-domain-name: www.simplereport.gov
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.okta.com
- okta-client-id: 0oa5ahrdfSpxmNZO74h6
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ - uses: ./.github/actions/stg-wait-for-slot-readiness
+ name: Wait for staging deploy to be ready
+ timeout-minutes: 1
with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
deploy:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment:
name: Production
@@ -108,18 +75,13 @@ jobs:
needs: [prerelease_backend]
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- name: Promote and deploy
uses: ./.github/actions/deploy-application
with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: client.tgz
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
slack_alert:
runs-on: ubuntu-latest
if: failure()
diff --git a/.github/workflows/deployStg.yml b/.github/workflows/deployStg.yml
index 9d21fd7e10d..105705a7689 100644
--- a/.github/workflows/deployStg.yml
+++ b/.github/workflows/deployStg.yml
@@ -5,123 +5,82 @@ on:
branches:
- main
-# on:
-# workflow_run:
-# workflows: ["Deploy Test"]
-# types:
-# - completed
-
env:
DEPLOY_ENV: stg
NODE_VERSION: 18
+
concurrency:
group: stg-deploy
cancel-in-progress: false
jobs:
build_docker:
- # if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
steps:
- uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- # if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ - name: Build and Push backend
+ uses: ./.github/actions/build-and-push
+ with:
+ acr_registry: ${{ secrets.ACR_REPO_URL }}
+ acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
+ acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
+
+ build_frontend:
runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
+ - uses: ./.github/actions/build-frontend
+ name: Build front-end application
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct release to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- # if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: ./client.tgz
+ deploy_env: ${{env.DEPLOY_ENV}}
+ smarty_streets_key: ${{ secrets.SMARTY_STREETS_KEY }}
+ okta_enabled: true
+ okta_url: https://hhs-prime.okta.com
+ okta_client_id: 0oa62qncijWSeQMuc4h6
+
+ prerelease_backend:
runs-on: ubuntu-latest
+ needs: [build_frontend, build_docker]
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
+ - uses: ./.github/actions/tf-deploy
+ name: Deploy with Terraform
with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ terraform_arm_client_id: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
+ terraform_arm_client_secret: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
+ terraform_arm_subscription_id: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
+ terraform_arm_tenant_id: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
+ okta_api_token: ${{ secrets.OKTA_API_TOKEN }}
+ - uses: ./.github/actions/stg-wait-for-slot-commit
+ name: Wait for correct commit to be deployed in staging slot
+ timeout-minutes: 5
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.okta.com
- okta-client-id: 0oa62qncijWSeQMuc4h6
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ - uses: ./.github/actions/stg-wait-for-slot-readiness
+ name: Wait for staging deploy to be ready
+ timeout-minutes: 1
with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
deploy:
- # if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment:
- name: Staging
- url: https://stg.simplereport.gov
+ name: ${{ env.DEPLOY_ENV }}
+ url: https://${{ env.DEPLOY_ENV }}.simplereport.gov
needs: [prerelease_backend]
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- name: Promote and deploy
uses: ./.github/actions/deploy-application
with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: client.tgz
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
slack_alert:
runs-on: ubuntu-latest
if: failure()
diff --git a/.github/workflows/deployTest.yml b/.github/workflows/deployTest.yml
index 8b8f7f213d3..53a6ece0d46 100644
--- a/.github/workflows/deployTest.yml
+++ b/.github/workflows/deployTest.yml
@@ -8,6 +8,7 @@ on:
env:
DEPLOY_ENV: test
NODE_VERSION: 18
+
concurrency:
group: test-deploy
cancel-in-progress: false
@@ -15,103 +16,71 @@ concurrency:
jobs:
build_docker:
runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
steps:
- uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
+ - name: Build and Push backend
+ uses: ./.github/actions/build-and-push
+ with:
+ acr_registry: ${{ secrets.ACR_REPO_URL }}
+ acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
+ acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
+
+ build_frontend:
runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
- with:
- terraform_version: 1.3.3
- - name: Build ReportStream function app
- uses: ./.github/actions/build-reportstream-functions
+ - uses: ./.github/actions/build-frontend
+ name: Build front-end application
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: ./client.tgz
+ deploy_env: ${{env.DEPLOY_ENV}}
+ smarty_streets_key: ${{ secrets.SMARTY_STREETS_KEY }}
+ okta_enabled: true
+ okta_url: https://hhs-prime.oktapreview.com
+ okta_client_id: 0oa1khettjHnj3EPT1d7
+
+ prerelease_backend:
runs-on: ubuntu-latest
+ needs: [build_frontend, build_docker]
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
+ - uses: ./.github/actions/tf-deploy
+ name: Deploy with Terraform
with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ terraform_arm_client_id: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
+ terraform_arm_client_secret: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
+ terraform_arm_subscription_id: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
+ terraform_arm_tenant_id: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
+ okta_api_token: ${{ secrets.OKTA_API_TOKEN_NONPROD }}
+ - uses: ./.github/actions/stg-wait-for-slot-commit
+ name: Wait for correct commit to be deployed in staging slot
+ timeout-minutes: 5
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- okta-enabled: true
- okta-url: https://hhs-prime.oktapreview.com
- okta-client-id: 0oa1khettjHnj3EPT1d7
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ - uses: ./.github/actions/stg-wait-for-slot-readiness
+ name: Wait for staging deploy to be ready
+ timeout-minutes: 1
with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
deploy:
runs-on: ubuntu-latest
environment:
- name: Test
- url: https://test.simplereport.gov
+ name: ${{ env.DEPLOY_ENV }}
+ url: https://${{ env.DEPLOY_ENV }}.simplereport.gov
needs: [prerelease_backend]
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- name: Promote and deploy
uses: ./.github/actions/deploy-application
with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: client.tgz
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
slack_alert:
runs-on: ubuntu-latest
if: failure()
diff --git a/.github/workflows/deployTraining.yml b/.github/workflows/deployTraining.yml
index 6b4cc8dcedf..73690e42be5 100644
--- a/.github/workflows/deployTraining.yml
+++ b/.github/workflows/deployTraining.yml
@@ -9,109 +9,77 @@ on:
env:
DEPLOY_ENV: training
NODE_VERSION: 18
+
concurrency:
group: training-deploy
cancel-in-progress: false
jobs:
build_docker:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: ./backend
steps:
- uses: actions/checkout@v4
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ACR
- run: docker login ${{ secrets.ACR_REPO_URL }} -u ${{ secrets.ACR_ADMIN_USERNAME }} -p ${{ secrets.ACR_ADMIN_PASWORD }}
- - name: Build and push Docker images
- run: ./build_and_push.sh
- prerelease_backend:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ - name: Build and Push backend
+ uses: ./.github/actions/build-and-push
+ with:
+ acr_registry: ${{ secrets.ACR_REPO_URL }}
+ acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
+ acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
+
+ build_frontend:
runs-on: ubuntu-latest
- needs: [build_frontend, build_docker]
- defaults:
- run:
- working-directory: ./ops
- env: # all Azure interaction is through terraform
- ARM_CLIENT_ID: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
- ARM_CLIENT_SECRET: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
- ARM_SUBSCRIPTION_ID: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
- ARM_TENANT_ID: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
- OKTA_API_TOKEN: ${{ secrets.OKTA_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: hashicorp/setup-terraform@v2.0.3
+ - uses: ./.github/actions/build-frontend
+ name: Build front-end application
with:
- terraform_version: 1.3.3
- - name: Terraform Init
- run: make init-${{ env.DEPLOY_ENV }}
- - name: Terraform deploy (infrastructure and staging slot)
- run: make deploy-${{ env.DEPLOY_ENV }}
- - name: Wait for correct commit to be deployed in staging slot
- timeout-minutes: 5
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-commit
- - name: Wait for staging deploy to be ready
- timeout-minutes: 1
- run: make wait-for-${{ env.DEPLOY_ENV }}-slot-readiness
- build_frontend:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: ./client.tgz
+ deploy_env: ${{env.DEPLOY_ENV}}
+ smarty_streets_key: ${{ secrets.SMARTY_STREETS_KEY }}
+ okta_enabled: false
+
+ prerelease_backend:
runs-on: ubuntu-latest
+ needs: [build_frontend, build_docker]
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-node@v3.8.1
- with:
- node-version: ${{env.NODE_VERSION}}
- - name: Use cache for node_modules
- uses: actions/cache@v3.3.2
+ - uses: ./.github/actions/tf-deploy
+ name: Deploy with Terraform
with:
- path: |
- ./frontend/node_modules
- key: npm-${{env.NODE_VERSION}}-${{ hashFiles('frontend/yarn.lock', 'frontend/package.json') }}
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - uses: ./.github/actions/build-frontend
- name: Build front-end application
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ terraform_arm_client_id: ${{ secrets.TERRAFORM_ARM_CLIENT_ID }}
+ terraform_arm_client_secret: ${{ secrets.TERRAFORM_ARM_CLIENT_SECRET }}
+ terraform_arm_subscription_id: ${{ secrets.TERRAFORM_ARM_SUBSCRIPTION_ID }}
+ terraform_arm_tenant_id: ${{ secrets.TERRAFORM_ARM_TENANT_ID }}
+ okta_api_token: ${{ secrets.OKTA_API_TOKEN }}
+ - uses: ./.github/actions/stg-wait-for-slot-commit
+ name: Wait for correct commit to be deployed in staging slot
+ timeout-minutes: 5
with:
- deploy-env: ${{env.DEPLOY_ENV}}
- smarty-streets-key: ${{ secrets.SMARTY_STREETS_KEY }}
- client-tarball: ./client.tgz
- is-training-site: true
- okta-enabled: false
- - name: Save compiled frontend application
- uses: actions/upload-artifact@v3
- if: success()
+ deploy_env: ${{ env.DEPLOY_ENV }}
+ - uses: ./.github/actions/stg-wait-for-slot-readiness
+ name: Wait for staging deploy to be ready
+ timeout-minutes: 1
with:
- name: frontend-tarball
- path: client.tgz
- retention-days: 1
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
deploy:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment:
- name: Training
- url: https://training.simplereport.gov
+ name: ${{ env.DEPLOY_ENV }}
+ url: https://${{ env.DEPLOY_ENV }}.simplereport.gov
needs: [prerelease_backend]
steps:
- uses: actions/checkout@v4
- - uses: azure/login@v1
- with:
- creds: ${{ secrets.AZURE_CREDENTIALS }}
- - name: Retrieve frontend build
- uses: actions/download-artifact@v3
- with:
- name: frontend-tarball
- name: Promote and deploy
uses: ./.github/actions/deploy-application
with:
- client-tarball: client.tgz
- deploy-env: ${{env.DEPLOY_ENV}}
+ azure_creds: ${{ secrets.AZURE_CREDENTIALS }}
+ client_tarball: client.tgz
+ deploy_env: ${{ env.DEPLOY_ENV }}
+
slack_alert:
runs-on: ubuntu-latest
if: failure()
diff --git a/.github/workflows/testingWorkflow.yml b/.github/workflows/testingWorkflow.yml
index 73cf7cf18ba..a19cfd20a9b 100644
--- a/.github/workflows/testingWorkflow.yml
+++ b/.github/workflows/testingWorkflow.yml
@@ -25,8 +25,12 @@ permissions:
packages: write
jobs:
-
# Check for changes in the backend, cypress, database, frontend, and nginx directories
+ workflow_changes:
+ with:
+ what_to_check: ./.github
+ uses: ./.github/workflows/checkForChanges.yml
+
backend_changes:
with:
what_to_check: ./backend
@@ -54,9 +58,10 @@ jobs:
# Build Docker Images for the backend, cypress, database, frontend, and nginx
build_backend_image:
- if: needs.backend_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
+ if: needs.workflow_changes.outputs.has_changes == 'true' || needs.backend_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
needs:
- backend_changes
+ - workflow_changes
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -69,23 +74,19 @@ jobs:
- uses: actions/checkout@v3
- name: Build Backend Image
id: set_backend_version
- uses: ./.github/actions/build-docker-image
+ uses: ./.github/actions/docker-buildx
with:
- context: ./
file: ./backend/Dockerfile
- acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
- acr_registry: ${{ secrets.ACR_REPO_URL }}
- acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
- gh_registry: ghcr.io
gh_username: ${{ github.actor }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
image_name: backend
platform: ${{ matrix.platform }}
build_cypress_image:
- if: needs.cypress_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
+ if: needs.workflow_changes.outputs.has_changes == 'true' || needs.cypress_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
needs:
- cypress_changes
+ - workflow_changes
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -98,23 +99,19 @@ jobs:
- uses: actions/checkout@v3
- name: Build Cypress Image
id: set_cypress_version
- uses: ./.github/actions/build-docker-image
+ uses: ./.github/actions/docker-buildx
with:
- context: ./
file: ./cypress/Dockerfile
- acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
- acr_registry: ${{ secrets.ACR_REPO_URL }}
- acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
- gh_registry: ghcr.io
gh_username: ${{ github.actor }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
image_name: cypress
platform: ${{ matrix.platform }}
build_database_image:
- if: needs.database_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
+ if: needs.workflow_changes.outputs.has_changes == 'true' || needs.database_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
needs:
- database_changes
+ - workflow_changes
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -127,22 +124,19 @@ jobs:
- uses: actions/checkout@v3
- name: Build Database Image
id: set_database_version
- uses: ./.github/actions/build-docker-image
+ uses: ./.github/actions/docker-buildx
with:
context: ./backend/db-setup
- acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
- acr_registry: ${{ secrets.ACR_REPO_URL }}
- acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
- gh_registry: ghcr.io
gh_username: ${{ github.actor }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
image_name: database
platform: ${{ matrix.platform }}
build_frontend_image:
- if: needs.frontend_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
+ if: needs.workflow_changes.outputs.has_changes == 'true' || needs.frontend_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
needs:
- frontend_changes
+ - workflow_changes
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -155,14 +149,9 @@ jobs:
- uses: actions/checkout@v3
- name: Build Frontend Image
id: set_frontend_version
- uses: ./.github/actions/build-docker-image
+ uses: ./.github/actions/docker-buildx
with:
- context: ./
file: ./frontend/Dockerfile
- acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
- acr_registry: ${{ secrets.ACR_REPO_URL }}
- acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
- gh_registry: ghcr.io
gh_username: ${{ github.actor }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
image_name: frontend
@@ -177,9 +166,10 @@ jobs:
"REACT_APP_DISABLE_MAINTENANCE_BANNER=true"
build_frontend_lighthouse_image:
- if: needs.frontend_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
+ if: needs.workflow_changes.outputs.has_changes == 'true' || needs.frontend_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
needs:
- frontend_changes
+ - workflow_changes
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -192,14 +182,9 @@ jobs:
- uses: actions/checkout@v3
- name: Build Frontend Lighthouse Image
id: set_frontend_lighthouse_version
- uses: ./.github/actions/build-docker-image
+ uses: ./.github/actions/docker-buildx
with:
- context: ./
file: ./frontend/Dockerfile
- acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
- acr_registry: ${{ secrets.ACR_REPO_URL }}
- acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
- gh_registry: ghcr.io
gh_username: ${{ github.actor }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
image_name: frontend-lighthouse
@@ -212,9 +197,10 @@ jobs:
"REACT_APP_DISABLE_MAINTENANCE_BANNER=true"
build_nginx_image:
- if: needs.nginx_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
+ if: needs.workflow_changes.outputs.has_changes == 'true' || needs.nginx_changes.outputs.has_changes == 'true' || inputs.force_build == 'true' || github.ref == 'refs/heads/main'
needs:
- nginx_changes
+ - workflow_changes
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -227,13 +213,9 @@ jobs:
- uses: actions/checkout@v3
- name: Build Nginx Image
id: set_nginx_version
- uses: ./.github/actions/build-docker-image
+ uses: ./.github/actions/docker-buildx
with:
context: ./nginx
- acr_password: ${{ secrets.ACR_ADMIN_PASWORD }}
- acr_registry: ${{ secrets.ACR_REPO_URL }}
- acr_username: ${{ secrets.ACR_ADMIN_USERNAME }}
- gh_registry: ghcr.io
gh_username: ${{ github.actor }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
image_name: nginx
diff --git a/backend/build.gradle b/backend/build.gradle
index b9780872b3d..2d3f06ec08d 100644
--- a/backend/build.gradle
+++ b/backend/build.gradle
@@ -84,7 +84,7 @@ dependencies {
runtimeOnly 'org.springframework.session:spring-session-jdbc'
// App insights instrumentation
- implementation 'com.microsoft.azure:applicationinsights-core:3.4.16'
+ implementation 'com.microsoft.azure:applicationinsights-core:3.4.17'
// Twilio for SMS
implementation group: "com.twilio.sdk", name: "twilio", version: "9.9.1"
diff --git a/backend/gradle.lockfile b/backend/gradle.lockfile
index fac1b2cb3b6..e409d790d83 100644
--- a/backend/gradle.lockfile
+++ b/backend/gradle.lockfile
@@ -44,7 +44,7 @@ com.graphql-java:graphql-java-extended-validation:18.1-hibernate-validator-6.2.0
com.graphql-java:graphql-java:18.5=compileClasspath,runtimeClasspath
com.graphql-java:java-dataloader:3.1.2=compileClasspath,runtimeClasspath
com.ibm.icu:icu4j:72.1=compileClasspath,runtimeClasspath
-com.microsoft.azure:applicationinsights-core:3.4.16=compileClasspath,runtimeClasspath
+com.microsoft.azure:applicationinsights-core:3.4.17=compileClasspath,runtimeClasspath
com.nimbusds:content-type:2.2=compileClasspath,runtimeClasspath
com.nimbusds:lang-tag:1.6=compileClasspath,runtimeClasspath
com.nimbusds:nimbus-jose-jwt:9.22=compileClasspath,runtimeClasspath
diff --git a/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java b/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java
index e3eb8c77ba8..8622ab235d4 100644
--- a/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java
+++ b/backend/src/test/java/gov/cdc/usds/simplereport/service/DiseaseCacheServiceTest.java
@@ -34,7 +34,7 @@ void getDiseaseCacheWhenCachePopulated_successful() {
Map
- Testing Queue! {location.search} {location.state.patientId}
-
+ Testing Queue! {location.search} {location.state.patientId} +
+ ); +}; +export const renderWithUserWithFacility = () => ({ + user: userEvent.setup(), + ...render( + <> +diff --git a/frontend/src/app/patients/EditPatient.test.tsx b/frontend/src/app/patients/EditPatient.test.tsx index 96f16e3355b..3d3468cd455 100644 --- a/frontend/src/app/patients/EditPatient.test.tsx +++ b/frontend/src/app/patients/EditPatient.test.tsx @@ -12,9 +12,6 @@ import { PATIENT_TERM_CAP } from "../../config/constants"; import EditPatient, { GET_PATIENT, UPDATE_PATIENT } from "./EditPatient"; import EditPatientContainer from "./EditPatientContainer"; -jest.mock("@trussworks/react-uswds", () => ({ - ComboBox: () => <>>, -})); const mockStore = configureStore([]); const mockFacilityID = "b0d2041f-93c9-4192-b19a-dd99c0044a7e"; @@ -97,6 +94,7 @@ describe("EditPatient", () => { facility: null, testResultDelivery: null, tribalAffiliation: [null], + notes: null, }, }, }, @@ -133,7 +131,9 @@ describe("EditPatient", () => { facility: null, testResultDelivery: null, tribalAffiliation: undefined, + preferredLanguage: null, facilityId: null, + notes: "Red tent", }, }, result: { @@ -197,6 +197,9 @@ describe("EditPatient", () => { await user.type(name, "Fake Name"); await user.tab(); + const notes = await screen.findByLabelText("Notes", { exact: false }); + await user.type(notes, "Red tent"); + const saveAndStartButton = screen.getByText("Save and start test", { exact: false, }); @@ -226,6 +229,9 @@ describe("EditPatient", () => { await user.type(name, "Fake Name"); await user.tab(); + const notes = await screen.findByLabelText("Notes", { exact: false }); + await user.type(notes, "Red tent"); + const saveButton = screen.getAllByText("Save changes", { exact: false, })[0]; @@ -393,6 +399,7 @@ describe("EditPatient", () => { facility: null, testResultDelivery: null, tribalAffiliation: [null], + notes: null, }, }, }, diff --git a/frontend/src/app/patients/EditPatient.tsx b/frontend/src/app/patients/EditPatient.tsx index f9b6faff07e..9c982f237c7 100644 --- a/frontend/src/app/patients/EditPatient.tsx +++ b/frontend/src/app/patients/EditPatient.tsx @@ -54,6 +54,7 @@ export const GET_PATIENT = gql` id } testResultDelivery + notes } } `; @@ -92,6 +93,7 @@ interface GetPatientResponse { id: string; } | null; testResultDelivery: TestResultDeliveryPreference | null; + notes: string | null; }; } @@ -124,6 +126,7 @@ export const UPDATE_PATIENT = gql` $employedInHealthcare: Boolean $preferredLanguage: String $testResultDelivery: TestResultDeliveryPreference + $notes: String ) { updatePatient( facilityId: $facilityId @@ -153,6 +156,7 @@ export const UPDATE_PATIENT = gql` employedInHealthcare: $employedInHealthcare preferredLanguage: $preferredLanguage testResultDelivery: $testResultDelivery + notes: $notes ) { internalId } diff --git a/frontend/src/app/patients/__snapshots__/EditPatient.test.tsx.snap b/frontend/src/app/patients/__snapshots__/EditPatient.test.tsx.snap index 7ec56bbd3c4..c4edd5a3876 100644 --- a/frontend/src/app/patients/__snapshots__/EditPatient.test.tsx.snap +++ b/frontend/src/app/patients/__snapshots__/EditPatient.test.tsx.snap @@ -55,9 +55,8 @@ exports[`EditPatient facility select input matches screenshot 1`] = ` class="display-flex flex-align-center" > @@ -270,6 +268,1649 @@ exports[`EditPatient facility select input matches screenshot 1`] = ` > Preferred language +