Each push made uploading the project to the hosting
to folder: /var/www/mywebsite/_work/my-project/my-project/
and run it with PM2
how can I do so with GitLab, prefer to do so without Docker ?
Thanks, Arthur.
Previse code on GitHub:
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: |
npm i
cd client
npm i
npm run build
cd ..
pm2 stop 0
pm2 start 0
pm2 save
sudo service nginx restart