Skip to content

fix(Github Action): Schema validation and new build action #3

fix(Github Action): Schema validation and new build action

fix(Github Action): Schema validation and new build action #3

Workflow file for this run

name: Build index
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'catalog/**.yaml'
- 'catalog/**.yml'
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: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install yaml & jsonschema
run: pip install pyyaml jsonschema
- name: Build index
run: python -B main/.github/scripts/build_index.py --build-branch main --deploy-branch gh-pages --folders-to-scan datasets
- name: Get last commit message - main
id: last-commit-message-main
run: echo "msg=$(git -C main log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- 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 - main
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ steps.last-commit-message-main.outputs.msg }}
commit_options: '--amend --no-edit'
file_pattern: '*.json catalog/**.yaml'
push_options: '--force'
skip_fetch: true
repository: main
- 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'
file_pattern: '*.json'
push_options: '--force'
skip_fetch: true
repository: gh-pages