Sync cc.storyfox.cz #211
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 cc.storyfox.cz | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # 只在源码/配置变更时触发,避免生成物回推造成循环执行。 | |
| paths: | |
| - '.github/workflows/sync.yml' | |
| - 'scripts/**' | |
| - 'data/config/**' | |
| - 'templates/**' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'script.js' | |
| schedule: | |
| - cron: '7 */11 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install deps | |
| run: npm ci | |
| - name: Run sync | |
| run: npm run sync | |
| - name: Commit changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add index.html data/ | |
| git diff --cached --quiet || git commit -m "chore: auto sync cc quick page" | |
| - name: Push changes | |
| run: git push |