Files
webpreview/.github/workflows/deploy.yaml
yuetsh 564f0b3f21
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled
revert
2026-01-26 15:23:45 +08:00

52 lines
1.1 KiB
YAML

name: Deploy
on:
push:
branches:
- main
permissions:
contents: read
jobs:
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: 24
cache: npm
- 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
# with:
# host: ${{ secrets.HOST }}
# username: root
# key: ${{ secrets.KEY }}
# port: ${{ matrix.remote_port }}
# script_path: /root/WebPreview/backend.sh