From ce715c92b6f582a7efa8b0f080ba0c39d8ef9641 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 18 Nov 2024 16:30:01 +0300 Subject: [PATCH] Reverted to old ci.yml --- .github/workflows/ci.yml | 76 +++++++++++++++------------------------- 1 file changed, 29 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d0185a..2df5ff7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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