Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INF-652] Fix SSR Deploy #7450

Merged
merged 28 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
df3f718
Test doing just stage ssr deploy
sliptype Jan 25, 2024
afa7c59
Disable stuff
sliptype Jan 25, 2024
a1c4f25
Fix turbo cache keys
sliptype Jan 25, 2024
18517c9
Add secrets to build workflow
sliptype Jan 26, 2024
79aca63
Force no cache
sliptype Jan 26, 2024
4adb0b0
Simple build
sliptype Jan 26, 2024
97c8b64
Revert "Simple build"
sliptype Jan 26, 2024
4216083
Actually force no cache
sliptype Jan 26, 2024
520ba5f
Merge branch 'main' into sk-fix-ssr-deploy
sliptype Jan 30, 2024
698099a
Merge branch 'main' into sk-fix-ssr-deploy
sliptype Feb 2, 2024
1491182
Add trpc-server node_modules to web init
sliptype Feb 2, 2024
630472f
Make deploy job a xlarge to try rebuilding
sliptype Feb 2, 2024
299f7e7
Try persisting node_modules again
sliptype Feb 3, 2024
9304daa
Revert "Try persisting node_modules again"
sliptype Feb 3, 2024
ae66696
Revert "Actually force no cache"
sliptype Feb 3, 2024
319fecb
Revert "Add secrets to build workflow"
sliptype Feb 3, 2024
f839b09
Revert "Disable stuff"
sliptype Feb 3, 2024
b5b4b71
Revert "Test doing just stage ssr deploy"
sliptype Feb 3, 2024
12e7eca
Revert "Make deploy job a xlarge to try rebuilding"
sliptype Feb 3, 2024
bb476da
Revert "Force no cache"
sliptype Feb 3, 2024
2d6ccfa
Revert "Revert "Try persisting node_modules again""
sliptype Feb 3, 2024
6cd02bc
Final test
sliptype Feb 3, 2024
11e19cd
Only persist node_modules for ssr
sliptype Feb 3, 2024
2de752e
Move persist to job level
sliptype Feb 3, 2024
e793aa8
Force again
sliptype Feb 3, 2024
89d9be4
Cache bust
sliptype Feb 3, 2024
208e38d
Update package-lock
sliptype Feb 3, 2024
1a344ea
Finalize
sliptype Feb 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .circleci/src/jobs/@web-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ web-init:
- packages/common/node_modules
- packages/libs/node_modules
- packages/libs/dist
- packages/trpc-server/node_modules
- packages/trpc-server/dist

web-build-demo:
working_directory: ~/audius-protocol
Expand Down Expand Up @@ -85,6 +87,11 @@ web-build-ssr-staging:
build-type: ssr:stage
build-directory: packages/web/build-ssr-staging
build-name: build-ssr-staging
- persist_to_workspace:
root: ./
paths:
- node_modules
- packages/web/node_modules

web-test-staging:
working_directory: ~/audius-protocol
Expand Down Expand Up @@ -128,6 +135,11 @@ web-build-ssr-production:
build-type: ssr:prod
build-directory: packages/web/build-ssr-production
build-name: build-ssr-production
- persist_to_workspace:
root: ./
paths:
- node_modules
- packages/web/node_modules

web-deploy-demo:
working_directory: ~/audius-protocol
Expand Down
23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions packages/web/src/ssr/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ const DEBUG = false
const BROWSER_CACHE_TTL_SECONDS = 60 * 60 * 24

addEventListener('fetch', (event) => {
const sentry = SENTRY_DSN
? new Toucan({
dsn: SENTRY_DSN,
context: event,
request: event.request
})
: null
const sentry =
typeof SENTRY_DSN !== 'undefined'
? new Toucan({
dsn: SENTRY_DSN,
context: event,
request: event.request
})
: null
try {
event.respondWith(handleEvent(event))
} catch (e) {
Expand Down
3 changes: 2 additions & 1 deletion packages/web/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"build": {
"outputs": ["build/**", "build-ssr/**"],
"dependsOn": ["^build"],
"outputMode": "new-only"
"outputMode": "new-only",
"env": ["VITE_ENVIRONMENT", "VITE_SSR"]
},
"dist": {
"outputs": ["dist/**"],
Expand Down