ci: copiar .env ao usar fallback de APP_DIR (HOME)\n\n- Evita excluir .env* quando copiando para o diretório alternativo.\n- Garante que o container tenha envs ao subir fora do /srv.
This commit is contained in:
parent
82c16533da
commit
5ff93a354f
1 changed files with 13 additions and 46 deletions
55
.github/workflows/ci-cd-web-desktop.yml
vendored
55
.github/workflows/ci-cd-web-desktop.yml
vendored
|
|
@ -87,6 +87,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "$EFFECTIVE_APP_DIR"
|
mkdir -p "$EFFECTIVE_APP_DIR"
|
||||||
RSYNC_FLAGS="-az --inplace --no-times --no-perms --no-owner --no-group --delete"
|
RSYNC_FLAGS="-az --inplace --no-times --no-perms --no-owner --no-group --delete"
|
||||||
|
# Excluir .env apenas quando copiando para o diretório padrão (/srv) para preservar segredos locais
|
||||||
|
EXCLUDE_ENV="--exclude '.env*' --exclude 'apps/desktop/.env*' --exclude 'convex/.env*'"
|
||||||
|
if [ "$EFFECTIVE_APP_DIR" != "${APP_DIR:-/srv/apps/sistema}" ]; then
|
||||||
|
EXCLUDE_ENV=""
|
||||||
|
fi
|
||||||
rsync $RSYNC_FLAGS \
|
rsync $RSYNC_FLAGS \
|
||||||
--filter='protect node_modules' \
|
--filter='protect node_modules' \
|
||||||
--filter='protect node_modules/**' \
|
--filter='protect node_modules/**' \
|
||||||
|
|
@ -102,28 +107,7 @@ jobs:
|
||||||
--exclude 'node_modules/**' \
|
--exclude 'node_modules/**' \
|
||||||
--exclude '.pnpm-store' \
|
--exclude '.pnpm-store' \
|
||||||
--exclude '.pnpm-store/**' \
|
--exclude '.pnpm-store/**' \
|
||||||
--exclude '.env*' \
|
$EXCLUDE_ENV \
|
||||||
--exclude 'apps/desktop/.env*' \
|
|
||||||
--exclude 'convex/.env*' \
|
|
||||||
./ "$EFFECTIVE_APP_DIR"/ \
|
|
||||||
|| rsync $RSYNC_FLAGS \
|
|
||||||
--filter='protect node_modules' \
|
|
||||||
--filter='protect node_modules/**' \
|
|
||||||
--filter='protect .pnpm-store' \
|
|
||||||
--filter='protect .pnpm-store/**' \
|
|
||||||
--filter='protect .env' \
|
|
||||||
--filter='protect .env*' \
|
|
||||||
--filter='protect apps/desktop/.env*' \
|
|
||||||
--filter='protect convex/.env*' \
|
|
||||||
--exclude '.git' \
|
|
||||||
--exclude '.next' \
|
|
||||||
--exclude 'node_modules' \
|
|
||||||
--exclude 'node_modules/**' \
|
|
||||||
--exclude '.pnpm-store' \
|
|
||||||
--exclude '.pnpm-store/**' \
|
|
||||||
--exclude '.env*' \
|
|
||||||
--exclude 'apps/desktop/.env*' \
|
|
||||||
--exclude 'convex/.env*' \
|
|
||||||
./ "$EFFECTIVE_APP_DIR"/
|
./ "$EFFECTIVE_APP_DIR"/
|
||||||
|
|
||||||
- name: Install and build (Next.js)
|
- name: Install and build (Next.js)
|
||||||
|
|
@ -176,6 +160,10 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "$EFFECTIVE_APP_DIR"
|
mkdir -p "$EFFECTIVE_APP_DIR"
|
||||||
RSYNC_FLAGS="-az --inplace --no-times --no-perms --no-owner --no-group --delete"
|
RSYNC_FLAGS="-az --inplace --no-times --no-perms --no-owner --no-group --delete"
|
||||||
|
EXCLUDE_ENV="--exclude '.env*' --exclude 'apps/desktop/.env*' --exclude 'convex/.env*'"
|
||||||
|
if [ "$EFFECTIVE_APP_DIR" != "${APP_DIR:-/srv/apps/sistema}" ]; then
|
||||||
|
EXCLUDE_ENV=""
|
||||||
|
fi
|
||||||
rsync $RSYNC_FLAGS \
|
rsync $RSYNC_FLAGS \
|
||||||
--filter='protect node_modules' \
|
--filter='protect node_modules' \
|
||||||
--filter='protect node_modules/**' \
|
--filter='protect node_modules/**' \
|
||||||
|
|
@ -191,28 +179,7 @@ jobs:
|
||||||
--exclude 'node_modules/**' \
|
--exclude 'node_modules/**' \
|
||||||
--exclude '.pnpm-store' \
|
--exclude '.pnpm-store' \
|
||||||
--exclude '.pnpm-store/**' \
|
--exclude '.pnpm-store/**' \
|
||||||
--exclude '.env*' \
|
$EXCLUDE_ENV \
|
||||||
--exclude 'apps/desktop/.env*' \
|
|
||||||
--exclude 'convex/.env*' \
|
|
||||||
./ "$EFFECTIVE_APP_DIR"/ \
|
|
||||||
|| rsync $RSYNC_FLAGS \
|
|
||||||
--filter='protect node_modules' \
|
|
||||||
--filter='protect node_modules/**' \
|
|
||||||
--filter='protect .pnpm-store' \
|
|
||||||
--filter='protect .pnpm-store/**' \
|
|
||||||
--filter='protect .env' \
|
|
||||||
--filter='protect .env*' \
|
|
||||||
--filter='protect apps/desktop/.env*' \
|
|
||||||
--filter='protect convex/.env*' \
|
|
||||||
--exclude '.git' \
|
|
||||||
--exclude '.next' \
|
|
||||||
--exclude 'node_modules' \
|
|
||||||
--exclude 'node_modules/**' \
|
|
||||||
--exclude '.pnpm-store' \
|
|
||||||
--exclude '.pnpm-store/**' \
|
|
||||||
--exclude '.env*' \
|
|
||||||
--exclude 'apps/desktop/.env*' \
|
|
||||||
--exclude 'convex/.env*' \
|
|
||||||
./ "$EFFECTIVE_APP_DIR"/
|
./ "$EFFECTIVE_APP_DIR"/
|
||||||
- name: Deploy functions to Convex self-hosted
|
- name: Deploy functions to Convex self-hosted
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue