fix(deploy): seed .env.example into APP_DIR if missing
Deploy to route.crispygoat.com / deploy (push) Failing after 3s
Build / build (push) Has been cancelled

The Start Docker stack step does `cd $APP_DIR && [ -f .env ] || cp .env.example .env`
but never ensured .env.example existed in APP_DIR. The rsync in the Deploy step
also doesn't copy it. The first deploy on a fresh host therefore failed with
'cp: cannot stat .env.example' before ever bringing up the stack.

Fix: copy .env.example from the workspace into APP_DIR if it isn't already
there, before the cd.
This commit is contained in:
2026-06-05 23:17:10 +00:00
parent 66ef014ce7
commit 1c133c5e06
+2
View File
@@ -28,6 +28,8 @@ jobs:
run: |
APP_DIR=/home/tyler/route-commerce
mkdir -p $APP_DIR
# Seed .env.example into APP_DIR if missing (it lives in the repo, not in APP_DIR)
[ -f $APP_DIR/.env.example ] || cp .env.example $APP_DIR/.env.example
cd $APP_DIR
[ -f .env ] || cp .env.example .env
# Append production secrets to .env (overriding .env.example defaults)