- Move React/Vite frontend to apps/web/ (@budgetwise/web)
- Add apps/appwrite/ (@budgetwise/appwrite) to source-control the
Appwrite backend: declarative schema in appwrite.json (5 collections),
CLI-based deploy.sh for containerized use, functions/ dir for future
Appwrite Functions
- Add turbo.json for task orchestration (build, deploy, dev)
- Replace .gitlab-ci.yml with Woodpecker CI pipelines in .woodpecker/:
web-production.yml — push to main → build + rsync to prod
web-staging.yml — push to staging → build + rsync to staging
web-preview.yml — PR open → deploy to {pr}.{domain}; PR close → cleanup
appwrite.yml — schema changes in apps/appwrite/ → CLI deploy
- All secrets injected via Woodpecker CI (no committed .env files)
51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
# ── Web: Staging ──────────────────────────────────────────────────────────────
|
|
# Triggered on every push to `staging`.
|
|
# Builds with --mode staging (uses .env.staging locally; CI uses secrets).
|
|
#
|
|
# Required Woodpecker secrets:
|
|
# staging_url
|
|
# staging_appwrite_endpoint
|
|
# staging_appwrite_project_id
|
|
# ssh_private_key
|
|
# deploy_host
|
|
# deploy_user
|
|
# deploy_path
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
when:
|
|
- event: push
|
|
branch: staging
|
|
|
|
steps:
|
|
- name: build
|
|
image: node:20-alpine
|
|
environment:
|
|
VITE_APP_URL:
|
|
from_secret: staging_url
|
|
VITE_APPWRITE_ENDPOINT:
|
|
from_secret: staging_appwrite_endpoint
|
|
VITE_APPWRITE_PROJECT_ID:
|
|
from_secret: staging_appwrite_project_id
|
|
commands:
|
|
- npm ci
|
|
- npm run build:staging -w @budgetwise/web
|
|
|
|
- name: deploy
|
|
image: alpine
|
|
environment:
|
|
SSH_PRIVATE_KEY:
|
|
from_secret: ssh_private_key
|
|
DEPLOY_HOST:
|
|
from_secret: deploy_host
|
|
DEPLOY_USER:
|
|
from_secret: deploy_user
|
|
DEPLOY_PATH:
|
|
from_secret: deploy_path
|
|
commands:
|
|
- apk add --no-cache rsync openssh-client
|
|
- eval $(ssh-agent -s)
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
|
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
|
- ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts
|
|
- rsync -avz --delete apps/web/dist/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/staging/"
|