update action file
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-01-26 15:11:30 +08:00
parent 44944944ad
commit 9386f2e152

View File

@@ -5,34 +5,48 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
build-and-deploy: deploy:
runs-on: ubuntu-latest 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: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 22 node-version: 24
cache: npm cache: npm
- run: npm install - run: npm ci
- run: CI=false npm run build - run: npm run ${{ matrix.build_command }}
env:
CI: false
- uses: easingthemes/ssh-deploy@main - uses: easingthemes/ssh-deploy@main
with: with:
SSH_PRIVATE_KEY: ${{ secrets.KEY }} SSH_PRIVATE_KEY: ${{ secrets.KEY }}
REMOTE_HOST: ${{ secrets.HOST }} REMOTE_HOST: ${{ secrets.HOST }}
REMOTE_PORT: ${{ matrix.remote_port }}
ARGS: "-avzr --delete" ARGS: "-avzr --delete"
SOURCE: dist/ SOURCE: dist/
REMOTE_USER: root REMOTE_USER: root
TARGET: /root/WebPreview/build TARGET: /root/WebPreview/build
- uses: appleboy/ssh-action@v1.2.1 - uses: appleboy/ssh-action@main
with: with:
host: ${{ secrets.HOST }} host: ${{ secrets.HOST }}
username: root username: root
port: ${{ matrix.remote_port }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
script: | script: |
cd ~/WebPreview/api sh ~/WebPreview/backend.sh
git pull
sh ~/WebPreview/run.sh