fix(deploy): seed .env.example into APP_DIR if missing
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:
@@ -28,6 +28,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
APP_DIR=/home/tyler/route-commerce
|
APP_DIR=/home/tyler/route-commerce
|
||||||
mkdir -p $APP_DIR
|
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
|
cd $APP_DIR
|
||||||
[ -f .env ] || cp .env.example .env
|
[ -f .env ] || cp .env.example .env
|
||||||
# Append production secrets to .env (overriding .env.example defaults)
|
# Append production secrets to .env (overriding .env.example defaults)
|
||||||
|
|||||||
Reference in New Issue
Block a user