-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
84 additions
and
2 deletions.
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,51 @@ | ||
name: data combiner | ||
run-name: Building data for commit ${{ github.sha }} by ${{ github.actor }} | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
permissions: write-all | ||
jobs: | ||
build-data: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo content | ||
uses: actions/checkout@v2 | ||
|
||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: build data | ||
run: python src/combine_data.py | ||
|
||
- name: Archive generated files as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: generated-files | ||
path: ./api | ||
|
||
- name: Checkout production branch | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: production | ||
|
||
- name: Download generated files artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: generated-files | ||
path: ./api | ||
|
||
- name: Apply changes to production branch | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git diff-index --quiet HEAD || (git commit -a -m "Add generated files from main branch" --allow-empty && git push origin production) |
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,10 @@ | ||
from classes.data import Data | ||
|
||
|
||
if __name__ == "__main__": | ||
data = Data() | ||
data.read_data() | ||
data.combine_data() | ||
|
||
for error in data.errors: | ||
print(error) |