Two runtime gaps found via hwatu after the first successful deploy:
- /pkg/*.{js,wasm,css} 404'd because the running binary looked for
target/site (Cargo.toml's site-root, a build-time path) but the
deploy step copies the bundle to releases/<sha>/site with no
target/ prefix - LEPTOS_SITE_ROOT=site in the runtime env corrects
it.
- SITE_NAME is read via option_env! (compile-time), so writing it
only into the runtime env file never reached the binary - the
wordmark stayed "portal". Now exported for the Build step too.
Verified live: applied both fixes directly to the running deployment
first (no CI round-trip), confirmed via hwatu (no console errors,
hero renders, all three alternatives' forms present) before folding
them back into the workflow.
This commit is contained in:
@@ -41,8 +41,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# SITE_NAME is read via option_env! (src/app.rs) - compile-time,
|
||||||
|
# not a runtime env var - so it has to be set here, not just in
|
||||||
|
# the "Write service env" step below.
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo leptos build --release
|
run: SITE_NAME=${{ vars.PORTAL_SITE_NAME }} cargo leptos build --release
|
||||||
|
|
||||||
- name: Ship release
|
- name: Ship release
|
||||||
run: |
|
run: |
|
||||||
@@ -72,6 +75,11 @@ jobs:
|
|||||||
CONTENT_BRANCH=main
|
CONTENT_BRANCH=main
|
||||||
SITE_NAME=${{ vars.PORTAL_SITE_NAME }}
|
SITE_NAME=${{ vars.PORTAL_SITE_NAME }}
|
||||||
LEPTOS_SITE_ADDR=0.0.0.0:3010
|
LEPTOS_SITE_ADDR=0.0.0.0:3010
|
||||||
|
# Cargo.toml's site-root ("target/site") is a build-time path;
|
||||||
|
# the deploy layout copies the bundle to releases/<sha>/site
|
||||||
|
# (no target/ prefix) - override so the running binary looks
|
||||||
|
# in the right place for /pkg/*.
|
||||||
|
LEPTOS_SITE_ROOT=site
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# No sudo: the runner's own unit sets NoNewPrivileges=yes, which
|
# No sudo: the runner's own unit sets NoNewPrivileges=yes, which
|
||||||
|
|||||||
Reference in New Issue
Block a user