Skip to content

Commit

Permalink
ci: auto data fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
wxh06 committed Nov 10, 2023
1 parent e84b9dc commit a3f8080
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Fetch data

on:
push:
branches: [main]
schedule:
# Runs at 00:00 UTC.
- cron: "0 0 * * *"

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: stable

- run: git checkout -mB dist

- name: Fetch
run: go run .

- name: Commit
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -f src/contests.json public/users/
git commit --allow-empty -m "Fetch data"
- name: Push
run: git push --set-upstream origin dist

0 comments on commit a3f8080

Please sign in to comment.