Merge pull request #402 from datalad/fix-schema-display #94
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
name: push_catalog_to_gh_pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
run_job: ${{ steps.check_files.outputs.run_job }} | |
steps: | |
- name: Set up environment | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Almighty" | |
- name: Checkout main | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
fetch-depth: 0 | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: check modified files | |
id: check_files | |
run: | | |
echo "========== check if any modified files include *datalad_catalog/catalog/* ==========" | |
changed_files=$(git diff --name-only ${{ github.event.after }}..${{ github.event.before }}) | |
echo "::set-output name=run_job::false" | |
while read -r line; do | |
echo "changed file: $line" | |
if [[ $line == datalad_catalog/catalog/* ]]; then | |
echo "::set-output name=run_job::true" | |
break | |
fi | |
done <<< "$changed_files" | |
build: | |
needs: check | |
if: needs.check.outputs.run_job == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up environment | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Almighty" | |
- name: Checkout main | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Merge and push changes to gh-pages | |
run: | | |
git checkout gh-pages | |
git merge --no-ff -s recursive -X subtree=datalad_catalog/catalog main | |
git push origin gh-pages | |