Sync AI Knowledge Data from Yobi #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync AI Knowledge Data from Yobi | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fetch data from Yobi | |
| run: | | |
| mkdir -p api projects | |
| curl -sf https://yobi.tw93.fun/llms-full.txt -o llms-full.txt | |
| curl -sf https://yobi.tw93.fun/api/profile -o api/profile.json | |
| curl -sf https://yobi.tw93.fun/api/projects -o api/projects.json | |
| curl -sf https://yobi.tw93.fun/api/blog -o api/blog.json | |
| curl -sf https://yobi.tw93.fun/api/weekly -o api/weekly.json | |
| for slug in pake kaku miaoyan mole waza kami; do | |
| curl -sf "https://yobi.tw93.fun/projects/${slug}" -o "projects/${slug}.md" | |
| done | |
| - name: Commit if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add llms-full.txt api/ projects/ | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "chore: sync AI knowledge data from Yobi" | |
| git push | |
| fi |