Skip to content

Commit

Permalink
fix: deploy ovh ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Leoglme committed Jan 13, 2024
1 parent 9a47dbd commit 93a4dc7
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/deploy-ovh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,7 @@ jobs:
run: npm install

- name: 🛠️ Build App
run: npm run build

- name: 🗑️ Remove node_modules from .output/server
run: rm -rf .output/server/node_modules

- name: 📝 Modify package.json
run: |
mv .output/server/package.json .output/package.json
jq '{name: .name, version: .version, private: .private, dependencies: .bundledDependencies}' .output/package.json > .output/temp.json
mv .output/temp.json .output/package.json
- name: 📝 Create server.js
run: echo "import('./server/index.mjs');" > .output/server.js
run: npm run generate

- name: 📤 Deploy to VPS
uses: appleboy/scp-action@master
Expand All @@ -48,17 +36,16 @@ jobs:
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: ".output/"
source: "dist/"
target: ${{ env.APP_DIR }}/html

- name: 🚀 Install dependencies and restart Server with PM2
- name: 🚀 Restart Server with PM2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ${{ env.APP_DIR }}/html/.output
npm install
cd ${{ env.APP_DIR }}/html
pm2 restart gtarp.dibodev.com || PORT=3600 pm2 start server.js --name gtarp.dibodev.com

0 comments on commit 93a4dc7

Please sign in to comment.