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
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
41f6af4
Refactor codes: move content of db folder to tools.
lauravuo fa378e6
Add data fetch script.
lauravuo 2fb9e50
Fetch only changed events on update.
lauravuo a790c44
Render array items to view.
lauravuo 83fbdf3
Add initial fetch data workflow.
lauravuo 2ba062b
Fix workflow trigger name.
lauravuo e9bcfd6
Add data update steps to fetch workflow.
lauravuo 2bac413
Fix issues with fetch workflow.
lauravuo 610d3bb
Configure git committer on data update.
lauravuo 46ecd07
Run fetch on main branch.
lauravuo fe94ae1
Fix missing EOF newlines.
lauravuo 15af7f1
Use dev branch for testing action.
lauravuo 53b29fd
Add updates from db.
d728854
Remove changes for testing in dev-branch.
lauravuo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import events0 from "./2021/06.json"; | ||
import events1 from "./2021/07.json"; | ||
|
||
const data = [ | ||
...events0, | ||
...events1 | ||
]; | ||
export default data; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Tue Mar 15 2022 19:38:13 GMT+0200 (Eastern European Standard Time) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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