read schema from resources #22
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: Build schemas | |
# when main changed rebuild the products (schemas and documentations) and updates the build folder | |
on: | |
push: | |
branches: [ main ] | |
permissions: write-all | |
jobs: | |
build-and-publish: | |
name: Build main branch | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.9' ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
pipx install poetry | |
- name: Install dependencies | |
run: | | |
poetry install --no-interaction | |
- name: Set PYTHONPATH | |
run: | | |
echo "PYTHONPATH=$PYTHONPATH:$(pwd)/src" >> $GITHUB_ENV | |
- name: Generate merged and expanded schemas | |
run: | | |
make expanded_schemas | |
- name: Commit files | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git diff --quiet && git diff --staged --quiet || git commit -a -m "Main branch build" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.P_TOKEN }} | |
branch: ${{ github.head_ref }} |