From d1c997d857c98bb0755ffed7accfde2d1608125b Mon Sep 17 00:00:00 2001 From: MarcUs7i <96580944+MarcUs7i@users.noreply.github.com> Date: Mon, 24 Mar 2025 09:13:12 +0100 Subject: [PATCH] Added workflow & updated README.md --- .github/workflows/deploy.yml | 27 +++++++++++++++++++++++++++ README.md | 36 +----------------------------------- ecosystem.config.cjs | 14 ++++++++++++++ 3 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 ecosystem.config.cjs diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ef17ac6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index 909d851..78a0184 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,4 @@ # MarcUs7i.Net marcus7i.net © 2025 by MarcUs7i is licensed under CC BY-NC 4.0
-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 -``` \ No newline at end of file +This is the source code for [marcus7i.net](https://marcus7i.net) \ No newline at end of file diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs new file mode 100644 index 0000000..9c3bf11 --- /dev/null +++ b/ecosystem.config.cjs @@ -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' + }] +} \ No newline at end of file