-
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
test
committed
Sep 25, 2023
1 parent
75880ba
commit 7bca1b8
Showing
2 changed files
with
10 additions
and
17 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 |
---|---|---|
|
@@ -35,18 +35,9 @@ jobs: | |
- name: Execute json_generator | ||
run: python json_generator.py | ||
|
||
- name: Commit json file | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add datasets.json | ||
git commit -m "Generating new json file." | ||
- name: Push changes to json branch | ||
uses: ad-m/[email protected] | ||
|
||
- name: Deploy | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: json | ||
|
||
|
||
folder: json # The folder the action should deploy. | ||
branch: json |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import yaml, glob, json | ||
import yaml, glob, json, os | ||
|
||
if not os.path.isdir("./json"): | ||
os.mkdir("json") | ||
|
||
import glob | ||
dataset = {"data": []} | ||
for file in glob.glob("./datasets/*.yaml"): | ||
with open(file, 'r') as yaml_file: | ||
dataset['data'].append(yaml.safe_load(yaml_file)) | ||
|
||
with open('datasets.json', 'w') as file: | ||
with open('./json/datasets.json', 'w') as file: | ||
file.write(json.dumps(dataset, indent=2)) |