46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: Build and Deploy
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
pull_request:
|
||
branches:
|
||
- main
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: Checkout code
|
||
uses: https://gitea.com/actions/checkout@v6
|
||
|
||
- name: Install Bun
|
||
run: |
|
||
curl -fsSL https://bun.sh/install -o bun_install.sh
|
||
# 根据你的系统架构修改 URL,例如 Linux x86_64
|
||
sed -i 's|bun_uri=.*|bun_uri="https://registry.npmmirror.com/-/binary/bun/bun-v1.3.9/bun-linux-x64.zip"|' bun_install.sh
|
||
bash bun_install.sh
|
||
export PATH="$HOME/.bun/bin:$PATH"
|
||
bun --version
|
||
|
||
- name: Install dependencies
|
||
run: |
|
||
export PATH="$HOME/.bun/bin:$PATH"
|
||
bun install --registry=https://registry.npmmirror.com
|
||
|
||
- name: Build project
|
||
run: |
|
||
export PATH="$HOME/.bun/bin:$PATH"
|
||
bun run build
|
||
|
||
- name: Deploy to server
|
||
uses: appleboy/scp-action@v0.1.7
|
||
with:
|
||
host: baishe.vps.honor3.com
|
||
port: 22
|
||
username: root
|
||
password: ${{ secrets.SSH_PWD }}
|
||
source: "dist/*"
|
||
target: "/app/staticwebs/seckit"
|