From 47f46d477a317b62167a1f0f547cf132ace99081 Mon Sep 17 00:00:00 2001 From: caviri <45425937+caviri@users.noreply.github.com> Date: Sun, 8 Sep 2024 18:31:26 +0200 Subject: [PATCH] fix(Github Action): Schema validation and new build action --- .github/workflows/build_page.yml | 48 +++++++++++++++++++ README.md | 6 ++- catalog/datasets/0001-pneuma-dataset.yaml | 4 +- .../datasets/0002-pneuma-vision-dataset.yml | 4 +- catalog/schemas/datasets.json | 25 +++++----- catalog/templates/datasets_template.yaml | 4 +- 6 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/build_page.yml diff --git a/.github/workflows/build_page.yml b/.github/workflows/build_page.yml new file mode 100644 index 0000000..1733f18 --- /dev/null +++ b/.github/workflows/build_page.yml @@ -0,0 +1,48 @@ +name: Build page + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - 'src/*' + +permissions: + contents: write + +jobs: + build-index: + runs-on: ubuntu-latest + if: github.event.repository.fork == false + + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + fetch-depth: 2 + ref: 'main' + path: main + + - name: Checkout gh-pages + uses: actions/checkout@v4 + with: + fetch-depth: 2 + ref: 'gh-pages' + path: gh-pages + + - name: Copying src + run: cp -r main/src/* gh-pages/ + + - name: Get last commit message - gh-pages + id: last-commit-message-gh-pages + run: echo "msg=$(git -C gh-pages log -1 --pretty=%s)" >> $GITHUB_OUTPUT + + - name: Commit - gh-pages + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: ${{ steps.last-commit-message-gh-pages.outputs.msg }} + commit_options: '--amend --no-edit' + push_options: '--force' + skip_fetch: true + repository: gh-pages \ No newline at end of file diff --git a/README.md b/README.md index a866fe8..cb2fec0 100644 --- a/README.md +++ b/README.md @@ -62,18 +62,20 @@ Each of these assets type has one basic metadata file requested. 3. Fill the template with all requested data and start a Pull Request (PR) to this repository. 4. This will open a discussion thread with the community and moderators of the hub. 5. The PR approval will trigger a github action, validating the item added. -6. +6. The action will render the new information in the page #### How to add a new project to this Hub? +TBD #### How to add a new datasets/model/publication to the Hub? +TBD ### How the community can add a new research asset type? -Addidn or editing a research schema is as easy a modifying one of the files located in `/catalog/schemas` +Adding or editing a research schema is as easy a modifying one of the files located in `/catalog/schemas` ### How the community can add a new webapp? diff --git a/catalog/datasets/0001-pneuma-dataset.yaml b/catalog/datasets/0001-pneuma-dataset.yaml index 137005c..9562d00 100644 --- a/catalog/datasets/0001-pneuma-dataset.yaml +++ b/catalog/datasets/0001-pneuma-dataset.yaml @@ -13,8 +13,8 @@ tags: - "drone" source: "Zenodo" authors: - name: "Kim, Sohyeong" - orcid: "0000-0000-0000-0000" + - name: "Kim, Sohyeong" + orcid: "0000-0000-0000-0000" license: "CC BY 4.0" access_url: "https://zenodo.org/record/7426506/" documentation_url: "https://zenodo.org/record/7426506" diff --git a/catalog/datasets/0002-pneuma-vision-dataset.yml b/catalog/datasets/0002-pneuma-vision-dataset.yml index 41b96d7..af5ed45 100644 --- a/catalog/datasets/0002-pneuma-vision-dataset.yml +++ b/catalog/datasets/0002-pneuma-vision-dataset.yml @@ -15,8 +15,8 @@ tags: - "traffic safety" source: "Zenodo" authors: - name: "Barmpounakis, Emmanouil" - orcid: "0000-0000-0000-0000" + - name: "Barmpounakis, Emmanouil" + orcid: "0000-0000-0000-0000" license: "CC BY 4.0" access_url: "https://zenodo.org/record/10491409" documentation_url: "https://zenodo.org/record/10491409" diff --git a/catalog/schemas/datasets.json b/catalog/schemas/datasets.json index 00e58bd..4ca235d 100644 --- a/catalog/schemas/datasets.json +++ b/catalog/schemas/datasets.json @@ -56,19 +56,22 @@ "description": "The source or origin of the dataset" }, "authors": { - "type": "object", + "type": "array", "description": "The authors or creators of the dataset", - "properties": { - "name": { - "type": "string", - "description": "Name of the author of the dataset" + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the author of the dataset" + }, + "orcid": { + "type": "string", + "description": "ORCID of the researcher author of the dataset" + } }, - "orcid": { - "type": "string", - "description": "ORCID of the researcher author of the dataset" - } - }, - "required": ["name"] + "required": ["name"] + } }, "license": { "type": "string", diff --git a/catalog/templates/datasets_template.yaml b/catalog/templates/datasets_template.yaml index f6c0244..ab4e31e 100644 --- a/catalog/templates/datasets_template.yaml +++ b/catalog/templates/datasets_template.yaml @@ -12,8 +12,8 @@ tags: - tag 3 source: "National Meteorological Organization" authors: - name: "Dr. Jane Doe" - orcid: "0000-0002-1825-0097" + - name: "Dr. Jane Doe" + orcid: "0000-0002-1825-0097" license: "CC BY 4.0" access_url: "https://example.com/datasets/...." documentation_url: "https://example.com/datasets/...."