Skip to content

Commit 2a43b9d

Browse files
committed
ci: sync deploy-staging.yml webroot self-heal fix to main
Same reason as the original registration commit: workflow_run only executes using the workflow file version on the default branch, so a change made only on redesign silently doesn't take effect for automatic staging deploys until it's mirrored here too. Content is unchanged from the redesign branch's copy.
1 parent c08c1a7 commit 2a43b9d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/deploy-staging.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,17 @@ jobs:
161161
PHP="${DEPLOY_PHP:-php}"
162162
cd $DEPLOY_PATH
163163
164-
# Ensure the web root's build/ points to the app's compiled assets.
164+
# The staging web root is a standalone directory (not a symlink to
165+
# $DEPLOY_PATH/public), so it needs its own bootstrap: compiled
166+
# assets, uploaded file storage, and an index.php/.htaccess pair
167+
# pointing at the real app. Regenerated every deploy so a
168+
# recreated web root self-heals instead of silently 404ing.
165169
if [ -n "$DEPLOY_WEBROOT" ]; then
166170
ln -sfn $DEPLOY_PATH/public/build $DEPLOY_WEBROOT/build
167-
echo "==> Symlinked $DEPLOY_WEBROOT/build -> $DEPLOY_PATH/public/build"
171+
ln -sfn $DEPLOY_PATH/storage/app/public $DEPLOY_WEBROOT/storage
172+
cp $DEPLOY_PATH/public/.htaccess $DEPLOY_WEBROOT/.htaccess
173+
sed "s#__DIR__\.'/\.\.#'$DEPLOY_PATH#g" $DEPLOY_PATH/public/index.php > $DEPLOY_WEBROOT/index.php
174+
echo "==> Regenerated web root bootstrap ($DEPLOY_WEBROOT)"
168175
fi
169176
170177
echo "==> Caching configuration"

0 commit comments

Comments
 (0)