Skip to content

Commit

Permalink
chore: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Nov 9, 2023
1 parent 4a3252a commit b7d74d4
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,48 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- name: Check out code
uses: actions/checkout@v3
strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
node: [18]

- name: Install pnpm
uses: pnpm/action-setup@v2
steps:
- uses: actions/checkout@v3

- name: Setup Node.js environment
- name: Set node version to ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
node-version: ${{ matrix.node-version }}

- run: corepack enable

- name: Install dependencies
run: pnpm install
- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: pnpm build
run: nr build

- name: SSH Deploy admin
uses: easingthemes/ssh-deploy@v2.2.11
uses: easingthemes/ssh-deploy@v4.1.10
env:
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: '-avzr --delete'
SOURCE: 'apps/admin/dist'
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: '/www/wwwroot/admin.kuizuo.cn'

- name: SSH Deploy api
uses: easingthemes/ssh-deploy@v2.2.11
uses: easingthemes/ssh-deploy@v4.1.10
env:
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: '-avzr --delete'
SOURCE: 'apps/api/dist'
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: '/www/wwwroot/NodeProject/kz-admin'

- name: SSH Commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.PRIVATE_KEY }}
script: pm2 restart kz-admin
TARGET: '/www/wwwroot/NodeProject/nest-admin'

0 comments on commit b7d74d4

Please sign in to comment.