add vitepress and workflow
All checks were successful
Deploy to Aliyun OSS / deploy (push) Successful in 24s

This commit is contained in:
2026-04-21 20:02:53 +08:00
parent 1065700037
commit 0e5b3527b0
22 changed files with 2704 additions and 21 deletions

View File

@@ -0,0 +1,8 @@
{
"permissions": {
"allow": [
"Bash(node esbuild.config.mjs production)",
"WebSearch"
]
}
}

View File

@@ -1,19 +0,0 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."

81
.github/workflows/deploy.yaml vendored Normal file
View File

@@ -0,0 +1,81 @@
name: Deploy to Aliyun OSS
on:
push:
tags:
- "wiki-*" # 当推送 wiki-* 开头的 tag 时触发
branches:
- "main" # 当推送 main 分支时触发
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Set variable
run: |
REPO_NAME=${{ github.event.repository.name }}
# 判断触发类型
if [[ "${{ github.ref_type }}" == "tag" ]]; then
# Tag 触发:去掉 "wiki-" 前缀
TAG_NAME=${{ github.ref_name }}
CLEAN_TAG_NAME=${TAG_NAME#wiki-}
BASE_PATH="/$REPO_NAME/$CLEAN_TAG_NAME/"
else
# Branch 触发:使用仓库名
TAG_NAME=""
BASE_PATH="/$REPO_NAME/"
fi
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
echo "BASE_PATH=$BASE_PATH" >> $GITHUB_ENV
echo "Repository: $REPO_NAME"
echo "Tag: $TAG_NAME"
echo "Base path: $BASE_PATH"
- name: Checkout code
uses: actions/checkout@v6
- name: Fetch docs LFS files
run: |
git lfs install
git lfs fetch --include="docs/**"
- name: Update VitePress base path
run: |
sed -i "s|base: '.*'|base: '$BASE_PATH'|g" docs/.vitepress/config.mts
echo "Updated base path to: $BASE_PATH"
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Install dependencies
run: pnpm install
- name: Build VitePress
run: pnpm docs:build
- name: Setup Aliyun CLI
run: |
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
tar -xzf aliyun-cli-linux-latest-amd64.tgz
sudo mv aliyun /usr/local/bin/
aliyun configure set \
--profile default \
--mode AK \
--access-key-id ${{ secrets.OSS_ACCESS_KEY_ID }} \
--access-key-secret ${{ secrets.OSS_ACCESS_KEY_SECRET }} \
--region ${{ secrets.OSS_REGION }}
- name: Deploy to OSS
run: |
OSS_PATH=oss://${{ secrets.OSS_BUCKET }}$BASE_PATH
echo "Deploying to: $OSS_PATH"
aliyun oss cp docs/.vitepress/dist $OSS_PATH --recursive --update
env:
OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }}

Submodule .obsidian/plugins/obsidian-sample-plugin added at dc2fa22c4d

5
.secrets.example Normal file
View File

@@ -0,0 +1,5 @@
OSS_ENDPOINT =
OSS_ACCESS_KEY_ID =
OSS_ACCESS_KEY_SECRET =
OSS_BUCKET =
OSS_REGION =

19
CLAUDE.md Normal file
View File

@@ -0,0 +1,19 @@
## 代码风格
- 避免嵌套结构
- 特殊的、非常规的需要写注释
- 计划、规则文档用中文为主(专有名词、约定俗称可以用英文)
- 注释用中文为主(专有名词、约定俗称可以用英文)
- 变量、函数名、Docstring 用全英文
- 同一事物用统一表达
- 使用的依赖越少越好
- 选用简单直接的方式实现
- 代码、执行方式改变,调整已有的文档、计划,而非新建
本地运行 action
```bash
act push -j deploy \
--secret-file .secrets \
-e event.json
```

View File

@@ -1,3 +1,3 @@
---
brief: An omoospace project
---
---

18
deploy.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# 自动获取当前 Git 分支名
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
# 拼接 Tag 名称:wiki-分支名
TAG_NAME="wiki-$BRANCH_NAME"
echo "当前分支:$BRANCH_NAME"
echo "即将创建 Tag:$TAG_NAME"
# 创建本地 Tag
git tag "$TAG_NAME"
# 推送到远程仓库
git push origin "$TAG_NAME"
echo -e "\n✅ Tag 创建并推送成功:$TAG_NAME"

View File

@@ -0,0 +1,8 @@
import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "OmooLab",
description: "An OmooLab Project",
base: '/', // Replace with your repository name if deploying to GitHub Pages
})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
import DefaultTheme from 'vitepress/theme'
import Viewer from './components/Viewer.vue'
/** @type {import('vitepress').Theme} */
export default {
extends: DefaultTheme,
enhanceApp({ app }) {
app.component('Viewer', Viewer)
}
}

1
docs/index.md Normal file
View File

@@ -0,0 +1 @@
# OmooLab Wiki

View File

@@ -0,0 +1,7 @@
# 测试笔记 - Canvas 导出
这是一个用于测试 Canvas 导出功能的笔记。
<Viewer src="/Untitled.png" />
<Viewer src="/canvas.png" />

BIN
docs/public/Untitled.png LFS Normal file

Binary file not shown.

BIN
docs/public/canvas.png LFS Normal file

Binary file not shown.

5
event.json Normal file
View File

@@ -0,0 +1,5 @@
{
"repository": {
"name": "action-sandbox"
}
}

8
notes/Untitled.canvas Normal file
View File

@@ -0,0 +1,8 @@
{
"nodes":[
{"id":"7e7d72b0a9c50a3f","x":-233,"y":-166,"width":250,"height":60,"type":"text","text":"sdfsdgas"},
{"id":"c241e3a59c834dc3","x":-67,"y":21,"width":50,"height":299,"type":"text","text":"sadfasefasef"},
{"id":"d6852f6e96eaf1f5","x":16,"y":114,"width":224,"height":146,"type":"text","text":"asefasef"}
],
"edges":[]
}

7
notes/canvas.canvas Normal file
View File

@@ -0,0 +1,7 @@
{
"nodes":[
{"id":"860c29754b1b08bf","type":"text","text":"sdfasdf\nasdfasdfasdf\n# fsadfs fasdf asdf asdf ","x":8640,"y":-4480,"width":496,"height":293},
{"id":"ad3484c9e0322d05","type":"text","text":"发色粉撒而非","x":5200,"y":-1840,"width":1920,"height":4946}
],
"edges":[]
}

7
notes/测试导出.md Normal file
View File

@@ -0,0 +1,7 @@
# 测试笔记 - Canvas 导出
这是一个用于测试 Canvas 导出功能的笔记。
![](Untitled.canvas)
![[canvas.canvas]]

10
package.json Normal file
View File

@@ -0,0 +1,10 @@
{
"devDependencies": {
"vitepress": "2.0.0-alpha.17"
},
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
}
}

1388
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff