mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-12 02:20:28 +08:00
feat(docs): add VitePress documentation setup and deployment workflow
This commit is contained in:
43
.github/workflows/docs.yml
vendored
Normal file
43
.github/workflows/docs.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
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: Deploy to 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
|
||||
rm -rf /opt/1panel/www/sites/foxel.cc/index/*
|
||||
source: "Docs/.vitepress/dist/*"
|
||||
target: "/opt/1panel/www/sites/foxel.cc/index"
|
||||
Reference in New Issue
Block a user