Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
push:
branches:
- main

pull_request:
branches:
- '**'

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -32,6 +35,7 @@
CI: false

- name: Build & Start Server with PM2
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_IP }}
Expand Down
20 changes: 20 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
apps: [{
name: 'chesstools',
script: 'npm',
args: 'run start -- -p 3001',
cwd: '/root/chesstools/chesstools',
env: {
NODE_ENV: 'production',
PORT: 3001
},
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
error_file: '/var/log/chesstools-error.log',
out_file: '/var/log/chesstools-out.log',
log_file: '/var/log/chesstools.log',
time: true
}]
};
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python_env/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ chess==1.11.1
fentoimage==0.1.0
future==0.18.2
macholib==1.15.2
Pillow==10.3.0
Pillow==9.5.0
six==1.15.0
11 changes: 11 additions & 0 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ npm install

echo "Generating docker image"
docker build -t fen-generator .

echo "Building Next.js app..."
npm run build

echo "Starting Next.js app with PM2 on port 3001..."
pm2 delete chesstools 2>/dev/null || true
pm2 start ecosystem.config.js
pm2 save

echo "App started with PM2. Use 'pm2 logs chesstools' to view logs."
echo "Use 'pm2 status' to check status."