Scrape Kickstarter #207
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: Scrape Kickstarter | |
| on: | |
| schedule: | |
| # Runs every hour | |
| - cron: "0 */12 * * *" | |
| # Allow manual trigger from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| scrape: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Puppeteer browser | |
| run: npx puppeteer browsers install chrome | |
| - name: Scrape Kickstarter | |
| run: npm run scrape | |
| - name: Commit and push build-awesome-pro.json | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/build-awesome-pro.json | |
| # Only commit if something actually changed | |
| git diff --staged --quiet || git commit -m "chore: update campaign stats [skip ci]" | |
| git push |