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
Conversation
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.
Looking good! I left two nit pick comments, feel free to ignore them if you feel like it 😄
Everything seems to work fine from the React-side, but I can't see a passing workflow run in the Actions. However, I'm not sure if it's becase this is not in main? Should the nightly run happen when it's not in the main branch?
package.json
Outdated
"typescript": "4.6.2" | ||
} | ||
} | ||
} |
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: Maybe removing this newline is not necessary
.github/workflows/fetch.yml
Outdated
git config --global user.email fetch-bot | ||
git add . | ||
git commit -a -m "Add updates from db." | ||
git push origin main |
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
You're @eevajonnapanula right! The scheduled action will be run only with the default branch. I add the push event temporarily now that we can check if the action passes. |
Ok, so when testing in the correct branch, the job succeeds. Relevant parts are |
Purpose
data
-folder that contains the service events as json. The events are rendered to app main view (as a first test).fetch
) for updating the events json from Firebase. The script is run daily via GitHub actions (can be triggered also from the actions UI). Logic for the data updates will be tuned more later.fetch
-script also generates anindex.js
-file for easily include the events to React-components. Currently it includes all available events, but in production-phase the purpose is to include only the events in current month and onwards.Related Issues
I will create later issues for the missing functionality such as unit tests for the db scripts and issues mentioned above.
How to test
DB events inclusion to React: Start app in localhost and see that events are listed with index and title to main view.
DB scripts: Open Actions tab and see that the nightly run for workflow
fetch-data
has succeeded.