Skip to content

Commit

Permalink
触发博客生成流水线
Browse files Browse the repository at this point in the history
  • Loading branch information
Estom committed Jan 21, 2024
1 parent 8f27144 commit bf0ac0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/call_remote_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:
# pip install -r requirements.txt # 如果有依赖,请替换为实际的依赖安装命令

- name: Generate files with Python script
run: python ./notes/blog/docsify/build_sidebar.py # 替换为你的Python脚本路径
run: |
root_dir = $(pwd)
python ./blog/docsify/build_sidebar.py root_dir # 替换为你的Python脚本路径
- name: Commit generated files
run: |
Expand All @@ -36,7 +38,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main

- name: Call Remote API
run: |
curl -X GET http://8.141.4.34/#/
Expand Down
5 changes: 5 additions & 0 deletions blog/docsify/build_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
from os.path import splitext, basename, join, isdir, relpath, abspath
from os import listdir
import os
import sys

# docsify根目录
# root_dir='/root/gitee/notes'
root_dir='/root/gitee/notes'
# 要处理的文件或文件夹
exclude_start_with=['_','*','.']
Expand Down Expand Up @@ -172,4 +174,7 @@ def layer_traverse(base_path,now,depth):
第n-1层会生成n层目录的_sidebar
第n层生成之后所有目录的_sidebar
'''
if len(sys.argv) > 1:
root_dir = sys.argv[1]
print("root_dir is:", root_dir)
layer_traverse(root_dir,0,create_depth)

0 comments on commit bf0ac0a

Please sign in to comment.