Keep Up Daily #93
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: Keep Up Daily | |
| on: | |
| schedule: | |
| # 8:00 AM Central Time = 14:00 UTC (CDT) / 14:00 UTC (CST) | |
| - cron: "0 14 * * *" | |
| workflow_dispatch: # manual trigger | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| scrape-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| # ── Checkout ────────────────────────────── | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # ── Python setup ────────────────────────── | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| # ── Scraper ─────────────────────────────── | |
| - name: Run scraper | |
| env: | |
| GH_MODELS_TOKEN: ${{ secrets.GH_MODELS_TOKEN }} | |
| run: python -m scraper | |
| # ── Commit new data ─────────────────────── | |
| - name: Commit and push data | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add data/ | |
| git diff --quiet --cached || git commit -m "📰 Daily feed: $(date -u +%Y-%m-%d)" | |
| git push | |
| # ── Build static site ───────────────────── | |
| - name: Build site | |
| run: | | |
| mkdir -p _site/data | |
| cp web/index.html _site/ | |
| cp web/app.js _site/ | |
| # Copy all data JSON files into the site | |
| cp data/*.json _site/data/ 2>/dev/null || true | |
| # ── Deploy to GitHub Pages ──────────────── | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |