ci: Add Gitea Actions workflow for deployment
Some checks failed
Deploy Dimension47 / deploy (push) Failing after 34s
Some checks failed
Deploy Dimension47 / deploy (push) Failing after 34s
- Auto-deploy on push to main - Pull, build, migrate, restart with PM2 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
53
.gitea/workflows/deploy.yml
Normal file
53
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Deploy Dimension47
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: linux-amd64
|
||||
steps:
|
||||
- name: Pull latest code
|
||||
run: |
|
||||
cd /opt/dimension47
|
||||
git fetch origin
|
||||
git reset --hard origin/main
|
||||
|
||||
- name: Install Server Dependencies
|
||||
run: |
|
||||
cd /opt/dimension47/server
|
||||
npm ci --production=false
|
||||
|
||||
- name: Install Client Dependencies
|
||||
run: |
|
||||
cd /opt/dimension47/client
|
||||
npm ci
|
||||
|
||||
- name: Generate Prisma Client
|
||||
run: |
|
||||
cd /opt/dimension47/server
|
||||
npx prisma generate
|
||||
|
||||
- name: Run Migrations
|
||||
run: |
|
||||
cd /opt/dimension47/server
|
||||
npx prisma migrate deploy
|
||||
|
||||
- name: Build Client
|
||||
run: |
|
||||
cd /opt/dimension47/client
|
||||
npm run build
|
||||
|
||||
- name: Build Server
|
||||
run: |
|
||||
cd /opt/dimension47/server
|
||||
npm run build
|
||||
|
||||
- name: Restart Server
|
||||
run: |
|
||||
pm2 delete dimension47 2>/dev/null || true
|
||||
cd /opt/dimension47/server
|
||||
pm2 start dist/main.js --name dimension47
|
||||
pm2 save
|
||||
Reference in New Issue
Block a user