Skip to content

Commit

Permalink
Optimize scripts and action
Browse files Browse the repository at this point in the history
  • Loading branch information
ihavecoke committed Nov 2, 2023
1 parent d147466 commit 8687513
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/download_feishu_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,37 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Start export feishu pages
env:
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }}
FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }}
FEISHU_SPACE_ID: '7288219896826494980'
FEISHU_SPACE_ID: "7288219896826494980"
OUTPUT_DIR: ./feishu-pages
uses: longbridgeapp/feishu-pages@main

- uses: oven-sh/setup-bun@v1

- name: Copy feishu pages to repo
run: |
bun install
./scripts/cp_feishu_to_vitepress.sh
bun autocorrect --fix locales/
bun translate
bun run setup:vitepress
- name: Commit feishu pages to repo
run: |
git status
git add .
git config --global user.name "LongPort Github CI"
git config --global user.email "[email protected]"
git commit -a -m "Commit feishu pages to repo"
git config --global user.name "Longbridge Whale docs bot"
git config --global user.email "[email protected]"
git commit -a -m "Commit feishu updated pages to repo"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: New feishu pages version request review
base: dev
delete-branch: true
title: '[Docs] New feishu pages version request review'
title: "[Docs] New feishu pages version request review"
body: |
New feishu pages version request review
assignees: ihavecoke


5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"scripts": {
"cp_feishu_pages_to_vitepress": "./scripts/cp_feishu_to_vitepress.sh",
"export": "./scripts/export",
"autocort": "bun run autocorrect --fix locales/",
"translate": "node ./scripts/hk2cn.js",
"build": "vitepress build",
"dev": "vitepress dev",
"clean:vitepress": "rm -rf .vitepress/dist && rm -rf docs/*",
"clean:export": "rm -rf dist/*",
"clean": "bun run clean:export && bun run clean:vitepress",
"local:build": "bun run export && bun run translate && bun run build"
"local:build": "bun run export && bun run translate && bun run build",
"setup:vitepress": "bun run cp_feishu_pages_to_vitepress && bun run autocort && bun run translate"
},
"dependencies": {
"autocorrect-node": "^2.8.4",
Expand Down

0 comments on commit 8687513

Please sign in to comment.