Skip to content

spec: update api spec to v2.1.1 #12

spec: update api spec to v2.1.1

spec: update api spec to v2.1.1 #12

Workflow file for this run

# This workflow should generate code based on the openapi.yaml and commit it to the branch.
name: Update API Spec
# This workflow is triggered only when called by another workflow
on:
workflow_dispatch:
push:
paths:
- 'api/openapi.yaml'
jobs:
generate:
name: Generate code from OpenAPI spec
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Make Scripts Executable
run: |
chmod +x api/scripts/gen_docs.sh
chmod +x api/scripts/gen_spring.sh
chmod +x api/scripts/gen_typescript.sh
chmod +x api/scripts/install_tools.sh
chmod +x api/scripts/lint.sh
- name: Install Tools
run: ./api/scripts/install_tools.sh
shell: bash
- name: Lint
run: ./api/scripts/lint.sh
shell: bash
- name: Generate Docs
run: ./api/scripts/gen_docs.sh
shell: bash
- name: Generate Spring Code
run: ./api/scripts/gen_spring.sh
shell: bash
- name: Generate api.ts
run: ./api/scripts/gen_typescript.sh
shell: bash
- name: Setup Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Stage Generated Code
run: |
git add server/matching/generated
git add server/user/generated
git add server/gateway/generated
git add client/src/api.ts
git add docs/api.html
- name: Commit & Push Generated Code
run: |
git commit -m "gen: generate code and documentation based on latest version of openapi.yaml"
git push