Added workflow & updated README.md

This commit is contained in:
MarcUs7i 2025-03-24 09:13:12 +01:00
parent 30d747e046
commit d1c997d857
3 changed files with 42 additions and 35 deletions

27
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,27 @@
name: Deploy to Production
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: SSH and deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /var/www/marcus7i.net
git pull
npm ci
npm run build
pm2 reload ecosystem.config.cjs || pm2 start ecosystem.config.cjs
# For system restarts
pm2 save

View file

@ -1,38 +1,4 @@
# MarcUs7i.Net # MarcUs7i.Net
marcus7i.net © 2025 by MarcUs7i is licensed under CC BY-NC 4.0<br> marcus7i.net © 2025 by MarcUs7i is licensed under CC BY-NC 4.0<br>
This is the source code for [marcus7i.net](https://marcus7i.net) This is the source code for [marcus7i.net](https://marcus7i.net)
## Setup
Make sure to install dependencies:
```bash
# npm
npm install
```
## Development Server
Start the development server on `http://localhost:3000`:
```bash
# npm
npm run dev
```
## Production
Build the application for production:
```bash
# npm
npm run build
```
Locally preview production build:
```bash
# npm
npm run preview
```

14
ecosystem.config.cjs Normal file
View file

@ -0,0 +1,14 @@
module.exports = {
apps: [{
name: 'marcus7i',
script: '.output/server/index.mjs',
instances: 'max',
exec_mode: 'cluster',
env: {
NODE_ENV: 'production',
PORT: 9031
},
watch: false,
max_memory_restart: '1G'
}]
}