Skip to content

Commit

Permalink
feat: chache web deps in build
Browse files Browse the repository at this point in the history
  • Loading branch information
sprutton1 committed Sep 4, 2024
1 parent a5a81aa commit 90e1633
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/deploy-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,15 @@ jobs:
environment: ${{ inputs.environment }}
service: ${{ matrix.service }}
version: ${{ inputs.version }}
needs:
- invoke-and-check-cdn
secrets: inherit

set-maintenance-mode:
needs:
- invoke-and-check-cdn
- set-service-versions
uses: ./.github/workflows/set-maintenance-mode.yml
with:
environment: ${{ inputs.environment }}
needs:
- invoke-and-check-cdn
secrets: inherit

upgrade-web:
Expand Down Expand Up @@ -97,7 +96,6 @@ jobs:
needs:
- upgrade-web
- upgrade-and-migrate-sdf
if: always()
uses: ./.github/workflows/e2e-validation.yml
with:
environment: ${{ inputs.environment }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/upgrade-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ jobs:

- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: '18.18.2'

- uses: pnpm/action-setup@v4
cache: 'pnpm'

- name: Install dependencies
working-directory: app/web
Expand Down
8 changes: 4 additions & 4 deletions component/toolbox/scripts/ssm-scripts/si-service-maintenance
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ mainSteps:
- |
flip_or_stick() {
requested_state=$1
response_code=$(curl -s -o /dev/null -w "%{http_code}" localhost:5156/api/)
[[ "$response_code" == "200" ]] && [[ "$requested_state" == "y" ]] && killall -s USR2 {{ Service }}
response_code=$(curl -s -o /dev/null -w "%{http_code}" localhost:5156/)
[[ "$response_code" == "404" ]] && [[ "$requested_state" == "y" ]] && killall -s USR2 {{ Service }}
[[ "$response_code" == "503" ]] && [[ "$requested_state" == "n" ]] && killall -s USR2 {{ Service }}
}

check_state() {
requested_state=$1
response_code=$(curl -s -o /dev/null -w "%{http_code}" localhost:5156/api/)
response_code=$(curl -s -o /dev/null -w "%{http_code}" localhost:5156/)
if [[ "$response_code" == "503" ]] && [[ "$requested_state" == "y" ]]; then
echo "{\"instance_id\": \"{{ InstanceId }}\", \"status\": \"success\", \"service\": \"{{ Service }}\", \"mode\": \"maintenance\" }"
elif [[ "$response_code" == "200" ]] && [[ "$requested_state" == "n" ]]; then
elif [[ "$response_code" == "404" ]] && [[ "$requested_state" == "n" ]]; then
echo "{\"instance_id\": \"{{ InstanceId }}\", \"status\": \"success\", \"service\": \"{{ Service }}\", \"mode\": \"running\" }"
else
echo "{\"instance_id\": \"{{ InstanceId }}\", \"status\": \"failure\", \"service\": \"{{ Service }}\", \"mode\": \"Status code from API not valid for requested action. Response Code: $response_code, Maintenance Mode Requested: {{ Action }}\" }"
Expand Down

0 comments on commit 90e1633

Please sign in to comment.