mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-11 09:59:50 +08:00
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
name: Build and Deploy Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'Docs/**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy-docs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./Docs
|
|
run: bun install
|
|
|
|
- name: Build VitePress site
|
|
working-directory: ./Docs
|
|
run: bun run docs:build
|
|
|
|
- name: Prepare target directory on server
|
|
uses: appleboy/ssh-action@v1.0.3
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
username: ${{ secrets.SERVER_USERNAME }}
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
passphrase: ${{ secrets.SSH_PASSPHRASE }}
|
|
script_stop: true
|
|
script: |
|
|
mkdir -p /opt/1panel/www/sites/foxel.cc/index
|
|
|
|
- name: Upload documentation to server
|
|
uses: appleboy/scp-action@v1
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
username: ${{ secrets.SERVER_USERNAME }}
|
|
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
passphrase: ${{ secrets.SSH_PASSPHRASE }}
|
|
source: "Docs/.vitepress/dist/*"
|
|
target: "/opt/1panel/www/sites/foxel.cc/index"
|
|
strip_components: 3 |