-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (48 loc) · 1.55 KB
/
codegen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: codegen
on:
pull_request:
branches:
- main
jobs:
codegen:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v4
if: github.event.pull_request.head.repo.full_name == github.repository
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.MONDEY_FORMAT_BOT_PAT }}
- uses: actions/checkout@v4
if: github.event.pull_request.head.repo.full_name != github.repository
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- name: "Export openapi.json from fastapi app"
run: |
cd ../mondey_backend
pip install .
mondey-export-openapi-json
- run: pnpm install
- name: "Generate frontend fetch API client code"
run: pnpm openapi-ts
- uses: EndBug/add-and-commit@v9
with:
add: "*"
author_name: "github-actions[bot]"
author_email: "github-actions[bot]@users.noreply.github.com"
message: "update openapi.json & openapi-ts client"