Skip to content

Commit

Permalink
Merge pull request #547 from ertush/hotfix
Browse files Browse the repository at this point in the history
Reverted to old ci.yml
  • Loading branch information
ertush authored Nov 18, 2024
2 parents 6288c1c + ce715c9 commit 622f653
Showing 1 changed file with 29 additions and 47 deletions.
76 changes: 29 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,52 +19,6 @@ env:

jobs:

deploy:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['18.x']

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Build Dependencies
run : yarn global add pm2; yarn global add pnpm
- name: Deploy to VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_KEY }}
script: |
set -e
cd /var/www/kmhfr
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
if ! [[ -d './.git' ]]; then git init; fi
if ! [[ `git remote -v | awk '{print $1}' | head -n 1` =~ 'origin' ]]; then git remote add origin ${{ github.server_url }}${{ github.username }}/${{ github.repository }}.git; fi
git stash;
git pull origin main;
echo `pwd`;
- name: Install dependencies and build app
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: |
node -e """
const {exec} = require('node:child_process');
exec('ls . && pwd', (error, stdout, stderr) => {
console.log(\`stdout: \\n\${stdout}\`)
})
"""
- run: npm install -g pnpm
- run: pnpm install
- run: pnpm run build
- run: pnpm dlx pm2 startOrRestart /var/www/kmhfr/ecosystem.config.js --env local
- run: pnpm dlx pm2 save

# test:
# timeout-minutes: 60
# runs-on: ubuntu-latest
Expand All @@ -87,7 +41,35 @@ jobs:
# name: playwright-report
# path: playwright-report/
# retention-days: 30



deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Build Dependencies
run : yarn global add pm2; yarn global add pnpm
- name: Deploy to VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_KEY }}
script: |
set -e
cd /var/www/kmhfr
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
if ! [[ -d './.git' ]]; then git init; fi
if ! [[ `git remote -v | awk '{print $1}' | head -n 1` =~ 'origin' ]]; then git remote add origin ${{ github.server_url }}${{ github.username }}/${{ github.repository }}.git; fi
git stash
git pull origin main
pnpm install
pnpm run build
pnpm dlx pm2 startOrRestart ecosystem.config.js --env local
pnpm dlx pm2 save
Expand Down

0 comments on commit 622f653

Please sign in to comment.