Files
xuyueandClaude Opus 5.5 dc91b9b5db
Deploy / deploy (build, debian, 22) (push) Canceled after 0s
chore: 数据已迁到 SQLite,删掉 Postgres 迁移脚本、webpreview-db 服务和迁移文档
school 服务器以后要切换时,从 cdeb7c1 里找回(deploy.yaml 里写了)。
备份方法挪到 CLAUDE.md。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:36:33 +08:00

63 lines
1.7 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 暂时停用,需要时恢复。那台还没从 Postgres 迁到 SQLite:迁移脚本、webpreview-db 服务和
# 步骤文档已删除,从提交 cdeb7c1 里找回(git show cdeb7c1:docs/migrate-to-bun.md)
# - name: school
# build_command: build:staging
# remote_port: 8822
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.4
- name: Build client
run: |
bun install --frozen-lockfile --filter webpreview-client
bun 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: |
set -e
cd /root/WebPreview
git pull --ff-only origin main
docker compose up -d --build