From f93919b2d454bc33995b389a07b4be968e82bf2e Mon Sep 17 00:00:00 2001 From: Bob Zhao Date: Tue, 12 Dec 2023 10:43:10 -0500 Subject: [PATCH] make deploy script use ci value --- .github/workflows/smokeTestDeploy.yml | 36 ++++++++++++--------------- frontend/package.json | 3 ++- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/smokeTestDeploy.yml b/.github/workflows/smokeTestDeploy.yml index 0339bc7f465..e64afd98dfc 100644 --- a/.github/workflows/smokeTestDeploy.yml +++ b/.github/workflows/smokeTestDeploy.yml @@ -2,6 +2,7 @@ name: Smoke test deploy run-name: Smoke test the deploy for ${{ inputs.deploy_env }} by @${{ github.actor }} on: + push: workflow_dispatch: inputs: deploy_env: @@ -47,26 +48,21 @@ jobs: - name: Set up dependencies working-directory: frontend run: yarn install --prefer-offline - - name: create env file - working-directory: frontend - run: | - touch .env - echo REACT_APP_BASE_URL=https://${{ inputs.deploy_env }}.simplereport.gov/ >> .env - name: Run smoke test script working-directory: frontend - run: yarn smoke:prod:deploy + run: yarn smoke:prod:deploy:ci - slack_alert: - runs-on: ubuntu-latest - if: failure() - needs: [ smoke-test-front-and-back-end ] - steps: - - uses: actions/checkout@v4 - - name: Send alert to Slack - uses: ./.github/actions/slack-message - with: - username: ${{ github.actor }} - description: | - :siren-gif: Post-deploy smoke test couldn't verify that the frontend is talking to the backend. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} :siren-gif: - webhook_url: ${{ secrets.SR_ALERTS_SLACK_WEBHOOK_URL }} - user_map: $${{ secrets.SR_ALERTS_GITHUB_SLACK_MAP }} \ No newline at end of file +# slack_alert: +# runs-on: ubuntu-latest +# if: failure() +# needs: [ smoke-test-front-and-back-end ] +# steps: +# - uses: actions/checkout@v4 +# - name: Send alert to Slack +# uses: ./.github/actions/slack-message +# with: +# username: ${{ github.actor }} +# description: | +# :siren-gif: Post-deploy smoke test couldn't verify that the frontend is talking to the backend. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} :siren-gif: +# webhook_url: ${{ secrets.SR_ALERTS_SLACK_WEBHOOK_URL }} +# user_map: $${{ secrets.SR_ALERTS_GITHUB_SLACK_MAP }} \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 6efd49b8975..ba6b7b015ce 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -76,7 +76,8 @@ "build-storybook": "yarn create-storybook-public && REACT_APP_BACKEND_URL=http://localhost:8080 SASS_PATH=$(cd ./node_modules && pwd):$(cd ./node_modules/@uswds && pwd):$(cd ./node_modules/@uswds/uswds/packages && pwd):$(cd ./src/scss && pwd) storybook build -s storybook_public", "maintenance:start": "[ -z \"$MAINTENANCE_MESSAGE\" ] && echo \"MAINTENANCE_MESSAGE must be set!\" || (echo $MAINTENANCE_MESSAGE > maintenance.json && yarn maintenance:deploy && rm maintenance.json)", "maintenance:deploy": "[ -z \"$MAINTENANCE_ENV\" ] && echo \"MAINTENANCE_ENV must be set!\" || az storage blob upload -f maintenance.json -n maintenance.json -c '$web' --account-name simplereport${MAINTENANCE_ENV}app --overwrite", - "smoke:prod:deploy": "node prod-smoke.js" + "smoke:prod:deploy": "node prod-smoke.js", + "smoke:prod:deploy:ci": "node -r dotenv/config prod-smoke.js dotenv_config_path=.env.production dotenv_config_debug=true" }, "prettier": { "singleQuote": false