Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial events data and update script #6

Merged
merged 14 commits into from Mar 18, 2022
Merged
36 changes: 36 additions & 0 deletions .github/workflows/fetch.yml
@@ -0,0 +1,36 @@
name: fetch-data
on:
schedule:
- cron: "0 1 * * *" # run at 1 AM UTC
workflow_dispatch:
repository_dispatch:

jobs:
fetch-latest:
runs-on: ubuntu-latest
name: Fetch latest events from db
steps:
- uses: actions/checkout@v2
with:
ref: main
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: install deps
run: yarn install
- name: prep creds
run: echo $FB_CREDS > ./tools/firebase/creds.json
env:
FB_CREDS: ${{ secrets.FIREBASE_CREDENTIALS }}
- name: update data
run: yarn tools:db:fetch ./creds.json
- name: remove creds
run: rm ./tools/firebase/creds.json
# TODO: run tests and push only if they succeed
- name: commit changes
run: |
git config --global user.name fetch-bot
git config --global user.email fetch-bot
git add .
git commit -a -m "Add updates from db."
git push origin main
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: There should be a newline

1 change: 1 addition & 0 deletions data/2021/06.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions data/2021/07.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions data/index.js
@@ -0,0 +1,8 @@
import events0 from "./2021/06.json";
import events1 from "./2021/07.json";

const data = [
...events0,
...events1
];
export default data;
1 change: 1 addition & 0 deletions data/last-fetch.txt
@@ -0,0 +1 @@
Tue Mar 15 2022 19:38:13 GMT+0200 (Eastern European Standard Time)
56 changes: 0 additions & 56 deletions db/README.md

This file was deleted.