2022-10-06 14:59:54 -05:00
|
|
|
name: Generate OpenAPI SDK
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-10-06 15:04:24 -05:00
|
|
|
pull_request:
|
2022-10-06 14:59:54 -05:00
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate-typescript-axios:
|
|
|
|
runs-on: ubuntu-latest
|
2022-10-06 15:11:09 -05:00
|
|
|
name: OpenAPI Generator
|
2022-10-06 14:59:54 -05:00
|
|
|
steps:
|
|
|
|
# Checkout your code
|
|
|
|
- name: Checkout
|
2022-10-06 15:48:38 -05:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GH_TOKEN }}
|
2022-10-06 14:59:54 -05:00
|
|
|
|
|
|
|
# Use the action to generate a client package
|
|
|
|
# This uses the default path for the openapi document and thus assumes there is an openapi.json in the current workspace.
|
|
|
|
- name: Generate Typescript Axios Client
|
|
|
|
uses: openapi-generators/openapitools-generator-action@v1
|
|
|
|
with:
|
|
|
|
generator: typescript-axios
|
|
|
|
generator-tag: v6.2.0
|
|
|
|
openapi-file: server/immich-openapi-specs.json
|
|
|
|
|
|
|
|
# Do something with the generated client (likely publishing it somewhere)
|
|
|
|
- name: Do something with the client
|
|
|
|
run: |
|
2022-10-06 15:27:31 -05:00
|
|
|
git config --global init.defaultBranch main
|
2022-10-06 15:34:42 -05:00
|
|
|
git config --global pull.rebase false
|
2022-10-06 16:15:36 -05:00
|
|
|
git config --global user.email "alex.tran1502@gmail.com"
|
|
|
|
git config --global user.name "Alex Tran"
|
2022-10-06 15:21:17 -05:00
|
|
|
cd typescript-axios-client
|
|
|
|
git init
|
|
|
|
git add .
|
|
|
|
git commit -m "Update SDK"
|
2022-10-06 16:15:36 -05:00
|
|
|
git remote add origin https://immich-app:"${{ secrets.GH_TOKEN }}"@github.com/immich-app/immich-sdk-typescript-axios.git
|
2022-10-06 15:40:01 -05:00
|
|
|
git pull origin main --allow-unrelated-histories
|
2022-10-06 15:38:38 -05:00
|
|
|
git push origin main 2>&1 | grep -v 'To https'
|