Regenerate artifacts from biolink-model.yaml #1
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: Regenerate Biolink Model Artifacts | |
# Controls when the action will run. Triggers the workflow on push | |
# event but only for the master branch, and specifically on the biolink-model.yaml | |
on: | |
push: | |
branches: | |
- master | |
repository_dispatch: | |
types: trigger-build-artifacts | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Python Environment | |
uses: actions/setup-python@v2 | |
with: | |
# Version range or exact version of a Python version to use, using SemVer's version range syntax. | |
python-version: 3.9 | |
- name: Setup build environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential git wget curl | |
sudo apt-get install -y openjdk-8-jre | |
sudo apt-get install -y graphviz | |
wget https://github.com/joelittlejohn/jsonschema2pojo/releases/download/jsonschema2pojo-1.0.2/jsonschema2pojo-1.0.2.tar.gz | |
tar -xvzf jsonschema2pojo-1.0.2.tar.gz | |
pip install poetry | |
- name: Generate Biolink Model artifacts | |
run: | | |
export PATH=$PATH:`pwd`/jsonschema2pojo-1.0.2/bin | |
make -B install build | |
if [ $? -eq 0 ]; then | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add biolink-model.* | |
git add biolink-modeln.* | |
git add context* | |
git add biolink/model.py | |
git add biolink/pydanticmodel.py | |
git add java/BiolinkModel.java | |
git add graphviz/* | |
git add golr-views/* | |
git add pydantic/* | |
git add json-schema/biolink-model.json | |
git add prefix-map/biolink-model-prefix-map.json | |
git commit -m "Regenerate artifacts from biolink-model.yaml" | |
git push | |
else | |
echo "'make' failed to finish successfully" | |
fi | |
- name: Build documentation | |
run: | | |
poetry install | |
poetry run python scripts/jekyllmarkdowngen.py --yaml biolink-model.yaml --dir docs | |
cp biolink-model.yaml docs | |
cp predicate_mapping.yaml docs | |
- name: Deploy to gh-pages branch | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
GITHUB_TOKEN: ${{ github.token }} | |
REPOSITORY_NAME: biolink/biolink-model # The repository the action should deploy to | |
BRANCH: gh-pages # The branch the action should deploy to. | |
COMMIT_MESSAGE: 'Update documentation' | |
FOLDER: . # The folder the action should deploy. |