-
Notifications
You must be signed in to change notification settings - Fork 5
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
Load data into Vercel using GitHub Actions #161
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5216b2f
added neon db url and etl workflow
agennadi fd81eb3
added push trigger
agennadi b635477
added neon url
agennadi d04a7de
updated env example
agennadi f227d3d
added env artifact to the workflow
agennadi d802689
Merge branch 'master' into add_etl_workflow
agennadi 19d257a
updated etl workflow
agennadi a79e6d4
removed on push trigger
agennadi d05bb67
Update a comment in liquefaction_data_handler.py
agennadi 3e543da
merged master into the branch
agennadi e27cf4c
Merge branch 'add_etl_workflow' of https://github.com/sfbrigade/datas…
agennadi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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
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,45 @@ | ||
name: ETL to neon | ||
|
||
# Workflow triggers | ||
on: | ||
schedule: | ||
- cron: "0 2 * * 0" # Runs at 2am UTC every Sunday | ||
workflow_dispatch: # Allows manual triggering of the workflow | ||
|
||
jobs: | ||
neon-etl: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Get Run ID of Most Recent Successful Run | ||
id: get_run_id | ||
run: | | ||
response=$(curl -s -H "Authorization: token ${{ secrets.GH_PAT }}" \ | ||
"https://api.github.com/repos/sfbrigade/datasci-earthquake/actions/workflows/env_vars.yml/runs?status=completed&conclusion=success") | ||
run_id=$(echo $response | jq '.workflow_runs[0].id') | ||
echo "Run ID: $run_id" | ||
echo "run_id=$run_id" >> $GITHUB_ENV | ||
- name: Download .env Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: env-file | ||
github-token: ${{ secrets.GH_PAT }} | ||
repository: sfbrigade/datasci-earthquake | ||
run-id: ${{ env.run_id }} | ||
|
||
- name: ETL data to Neon DB | ||
run: | | ||
python -m backend.etl.tsunami_data_handler | ||
python -m backend.etl.soft_story_properties_data_handler | ||
python -m backend.etl.liquefaction_data_handler |
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
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
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
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
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
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
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
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.
Are there consequences to changing this script to connect to the Neon DB as opposed to the local DB? As in, if I want to test my local DB, do I need to change this line back to connect to
database_url_sqlalchemy
?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.
Yes, you'd have to change this line back to test locally. If this is a problem, I can add an if-clause that would switch the url based on the environment
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.
Ok, I think it’s fine for now. I would probably prefer putting more data in the test DB.