ci(convex): fix self-hosted deploy
- Acquire admin key in convex_deploy job (id:key) - Copy existing convex.json from APP_DIR to build dir (EFFECTIVE_APP_DIR) - Prevent ‘No CONVEX_DEPLOYMENT set’ by ensuring project link present
This commit is contained in:
parent
7ed7775c05
commit
c4265341ee
1 changed files with 18 additions and 0 deletions
18
.github/workflows/ci-cd-web-desktop.yml
vendored
18
.github/workflows/ci-cd-web-desktop.yml
vendored
|
|
@ -144,6 +144,15 @@ jobs:
|
|||
$EXCLUDE_ENV \
|
||||
./ "$EFFECTIVE_APP_DIR"/
|
||||
|
||||
- name: Acquire Convex admin key
|
||||
id: key
|
||||
run: |
|
||||
CID=$(docker ps --format '{{.ID}} {{.Names}}' | awk '/sistema_convex_backend/{print $1; exit}')
|
||||
if [ -z "$CID" ]; then echo "No convex container"; exit 1; fi
|
||||
KEY=$(docker exec -i "$CID" /bin/sh -lc './generate_admin_key.sh' | tr -d '\r' | grep -o 'convex-self-hosted|[^ ]*' | tail -n1)
|
||||
echo "ADMIN_KEY=$KEY" >> $GITHUB_OUTPUT
|
||||
echo "Admin key acquired? $([ -n "$KEY" ] && echo yes || echo no)"
|
||||
|
||||
- name: Copy production .env if present
|
||||
run: |
|
||||
DEFAULT_DIR="${APP_DIR:-/srv/apps/sistema}"
|
||||
|
|
@ -333,6 +342,15 @@ jobs:
|
|||
--exclude '.pnpm-store/**' \
|
||||
./ "$EFFECTIVE_APP_DIR"/
|
||||
|
||||
- name: Bring convex.json from live app if present
|
||||
run: |
|
||||
if [ -f "$APP_DIR/convex.json" ]; then
|
||||
echo "Copying $APP_DIR/convex.json -> $EFFECTIVE_APP_DIR/convex.json"
|
||||
cp -f "$APP_DIR/convex.json" "$EFFECTIVE_APP_DIR/convex.json"
|
||||
else
|
||||
echo "No existing convex.json found at $APP_DIR; convex CLI will need self-hosted vars"
|
||||
fi
|
||||
|
||||
- name: Set Convex env vars (self-hosted)
|
||||
env:
|
||||
CONVEX_SELF_HOSTED_URL: https://convex.esdrasrenan.com.br
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue