fix(deploy): write .env to /opt/staging not \$HOME/staging
All checks were successful
Deploy — Staging / Lint, Typecheck & Test (push) Successful in 1m27s
Deploy — Staging / Build & push — admin (push) Successful in 54s
Deploy — Staging / Build & push — storefront (push) Successful in 55s
Deploy — Staging / Deploy to staging VPS (push) Successful in 20s
All checks were successful
Deploy — Staging / Lint, Typecheck & Test (push) Successful in 1m27s
Deploy — Staging / Build & push — admin (push) Successful in 54s
Deploy — Staging / Build & push — storefront (push) Successful in 55s
Deploy — Staging / Deploy to staging VPS (push) Successful in 20s
\$HOME in an unquoted heredoc expands on the runner (not the VPS), so the VPS received the literal runner path (/root/staging/.env) which didn't exist. Using the explicit /opt/staging/.env path (consistent with compose.yml and mkdir) fixes the permission denied error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -213,8 +213,8 @@ jobs:
|
||||
# printf keeps every line indented (no column-0 content) so YAML stays valid.
|
||||
printf 'CLERK_SECRET_KEY=%s\nADMIN_CLERK_SECRET_KEY=%s\n' \
|
||||
"${CLERK_SECRET_KEY}" "${ADMIN_CLERK_SECRET_KEY}" \
|
||||
> $HOME/staging/.env
|
||||
chmod 600 $HOME/staging/.env
|
||||
> /opt/staging/.env
|
||||
chmod 600 /opt/staging/.env
|
||||
|
||||
cd /opt/staging
|
||||
podman compose up -d --force-recreate --remove-orphans
|
||||
|
||||
Reference in New Issue
Block a user