Skip to content

Commit

Permalink
make deploy script use ci value
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Dec 12, 2023
1 parent 2054e13 commit f93919b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/smokeTestDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
# 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 }}
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f93919b

Please sign in to comment.