From 9386f2e15286611368e683dfd3ac52954f77d390 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 26 Jan 2026 15:11:30 +0800 Subject: [PATCH] update action file --- .github/workflows/deploy.yaml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2b47beb..1bc4868 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -5,34 +5,48 @@ on: branches: - main +permissions: + contents: read + jobs: - build-and-deploy: + deploy: runs-on: ubuntu-latest + strategy: + matrix: + include: + - name: debian + build_command: build + remote_port: 22 + - name: school + build_command: build:staging + remote_port: 8822 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 24 cache: npm - - run: npm install - - run: CI=false npm run build + - run: npm ci + - run: npm run ${{ matrix.build_command }} + env: + CI: false - uses: easingthemes/ssh-deploy@main with: SSH_PRIVATE_KEY: ${{ secrets.KEY }} REMOTE_HOST: ${{ secrets.HOST }} + REMOTE_PORT: ${{ matrix.remote_port }} ARGS: "-avzr --delete" SOURCE: dist/ REMOTE_USER: root TARGET: /root/WebPreview/build - - uses: appleboy/ssh-action@v1.2.1 + - uses: appleboy/ssh-action@main with: host: ${{ secrets.HOST }} username: root + port: ${{ matrix.remote_port }} key: ${{ secrets.KEY }} script: | - cd ~/WebPreview/api - git pull - sh ~/WebPreview/run.sh + sh ~/WebPreview/backend.sh \ No newline at end of file