Files
web/.github/workflows/deploy.yaml
T
xuyueandClaude Opus 5.5 4b8109caaa
Deploy / deploy (build, debian, 22) (push) Canceled after 0s
ci: 暂时停用 school 服务器的部署
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 18:02:43 +08:00

64 lines
1.6 KiB
YAML

name: Deploy
on:
push:
branches:
- main
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: debian
build_command: build
remote_port: 22
# school 暂时停用,需要时恢复(并先按 docs/migrate-to-bun.md 切换那台服务器)
# - name: school
# build_command: build:staging
# remote_port: 8822
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: client/package-lock.json
- name: Build client
working-directory: client
run: |
npm install
npm run ${{ matrix.build_command }}
env:
CI: false
- name: Upload client to ${{ matrix.name }}
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.KEY }}
REMOTE_HOST: ${{ secrets.HOST }}
REMOTE_PORT: ${{ matrix.remote_port }}
ARGS: "-avzr --delete"
SOURCE: client/dist/
REMOTE_USER: root
TARGET: /root/WebPreview/build
- name: Update server on ${{ matrix.name }}
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
port: ${{ matrix.remote_port }}
username: root
key: ${{ secrets.KEY }}
script: |
cd /root/WebPreview
git pull --ff-only
docker compose up -d --build