Skip to content

Articles explorer (#10) #205

Articles explorer (#10)

Articles explorer (#10) #205

Workflow file for this run

name: Generate SDK
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
generate-sdk:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
cd backend
poetry install
- name: Generate SDK
run: |
cd backend
poetry run python generate_client_sdk.py -o ../frontend/sdk
- name: Commit and push SDK
run: |
cd frontend/sdk
if [ -n "$(git status --porcelain)" ]; then
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Auto-generate SDK [skip ci]"
git push
else
echo "No changes to commit."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}