43 lines
935 B
YAML
43 lines
935 B
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Bun
|
|
run: |
|
|
curl -fsSL https://bun.sh/install | bash
|
|
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.honor3.com
|
|
port: 22
|
|
username: root
|
|
password: ${{ secrets.SSH_PWD }}
|
|
source: "dist/*"
|
|
target: "/app/staticwebs/seckit"
|