Skip to content

Update Traffic Data #283

Update Traffic Data

Update Traffic Data #283

name: Update Traffic Data
on:
schedule:
- cron: '0 */12 * * *'
jobs:
update-traffic:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --production
- name: Update Traffic Data
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
GITHUB_USER: toFrankie
GITHUB_REPO: blog
run: bun run scripts/update-traffic-data.ts
- 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 docs/traffic
if git diff-index --quiet HEAD; then
echo "No changes detected."
else
git commit -m "docs: update traffic data"
git push
fi