Files
SkyMoney/.gitea/workflows/deploy.yml
Benny 75d011f6d6
Some checks failed
Deploy / deploy (push) Failing after 30s
Update docker-compose for production
2026-01-29 16:52:08 -06:00

51 lines
1.2 KiB
YAML

name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: vps-host
steps:
- uses: actions/checkout@v4
- name: Build Web
run: |
cd web
npm ci
npm run build
- name: Deploy with Docker Compose
run: |
# Deploy directory
APP_DIR=/opt/skymoney
mkdir -p $APP_DIR
# Sync repo to server (excluding node_modules, dist, etc)
rsync -a --delete \
--exclude=node_modules \
--exclude=dist \
--exclude=.git \
--exclude=.gitea \
--exclude=backups \
--exclude=exporting \
./ $APP_DIR/
# Copy built web to shared volume
mkdir -p /var/www/skymoney/dist
cp -r web/dist/* /var/www/skymoney/dist/
cd $APP_DIR
# Build and start all services
docker compose up -d --build
# Wait for database to be ready
sleep 10
# Run Prisma migrations inside the API container
docker compose exec -T api npx prisma migrate deploy
- name: Reload Nginx
run: sudo systemctl reload nginx