diff options
| author | BigCoke233 <hi@guhub.cn> | 2026-01-06 10:25:08 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2026-01-06 10:25:08 +0800 |
| commit | fbe23cb1ec8f5bee2962a11f13b52c4080c3f38e (patch) | |
| tree | 048e07de3f091cd0472b67b4960bc9312bbbc7c7 | |
| parent | 062176e960255e0bb50ef441f928219e11999925 (diff) | |
refactor: turn post-build scripts into CI workflows
| -rw-r--r-- | .github/workflows/extract-data.yml | 74 | ||||
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | build.sh | 9 |
3 files changed, 74 insertions, 12 deletions
diff --git a/.github/workflows/extract-data.yml b/.github/workflows/extract-data.yml new file mode 100644 index 00000000..ab9fba67 --- /dev/null +++ b/.github/workflows/extract-data.yml @@ -0,0 +1,74 @@ +name: Extract Data from Content + +on: + push: + branches: + - master + paths: + - 'content/**/*.md' + - 'scripts/*.go' + workflow_dispatch: + +jobs: + extract-highlights: + name: Extract Highlights + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Run extract_highlights.go + run: go run scripts/extract_highlights.go + + - name: Commit highlights data + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'chore: update highlights data' + file_pattern: 'data/highlights.json' + + generate-external-link-rank: + name: Generate External Link Rank + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Run get_external_link_rank.go + run: go run scripts/get_external_link_rank.go + + - name: Commit external links data + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'chore: update external link rank data' + file_pattern: 'data/externallinks.json' + + generate-link-graph: + name: Generate Internal Link Graph + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Run get_internal_link_graph.go + run: go run scripts/get_internal_link_graph.go + + - name: Commit link graph data + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'chore: update internal link graph data' + file_pattern: 'public/link-graph.json' @@ -11,6 +11,3 @@ content/posts/_template.md /content/.obsidian /content/templates /content/ebooks -static/link-graph.json -data/externallinks.json -data/highlights.json @@ -49,15 +49,6 @@ main() { # ===== Execute Pre-Hugo Actions ===== # - echo "🏗️ Running Custom Go Scripts" - - # compile scripts - ./scripts/build_scripts.sh - # execute them - ./scripts/extract_highlights - ./scripts/get_external_link_rank - ./scripts/get_internal_link_graph - echo "🏗️ Building UnoCSS..." npm run build:uno:prod |
