libretime/.github/workflows/api-schema.yml

41 lines
1.1 KiB
YAML
Raw Normal View History

name: API schema
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate:
if: github.repository_owner == 'libretime'
name: Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
2022-04-25 16:31:04 +02:00
- name: Clone client repo
uses: actions/checkout@v3
with:
2022-04-25 16:31:04 +02:00
repository: "${{ github.repository_owner }}/client"
path: client-repo
ssh-key: "${{ secrets.API_CLIENT_DEPLOY_KEY }}"
- name: Generate schema
run: |
make schema
2022-04-25 16:31:04 +02:00
cp schema.yml ../client-repo/schema.yml
working-directory: api
- name: Push schema changes to API clients
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: update schema for ${{ github.repository }}@${{ github.sha }}"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
2022-04-25 16:31:04 +02:00
repository: ./client-repo