Files
Project/.gitea/workflows/deploy.yaml
thenatespack 7cb29179a2
Some checks failed
Deploy Express API / deploy (push) Has been cancelled
Update deploy.yaml
2025-11-24 17:05:29 -07:00

42 lines
829 B
YAML

name: Deploy Express API
on:
push:
branches:
- backend
- main
jobs:
deploy:
runs-on: linux_amd64
steps:
# Checkout code
- uses: actions/checkout@v3
# Pull latest code
- name: Pull latest code
run: |
cd /var/www/myapp/Project
git reset --hard
git pull origin main
# Install dependencies
- name: Install dependencies
run: |
cd /var/www/myapp/Project
npm install
# Kill existing process (optional)
- name: Stop previous instance
run: |
pkill -f "node .*app.js" || true
pkill -f "node .*start.js" || true
# Start app in background
- name: Start app
run: |
cd /var/www/myapp/Project
nohup npm start > app.log 2>&1 &