This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (71 loc) · 2.25 KB
/
openapi.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: OpenAPI 🔀
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
generate:
runs-on: ubuntu-latest
env:
DEBUG: True
KEY: ${{ secrets.OCIAL_KEY }}
DB_NAME: ocialdb
DB_USERNAME: ${{ secrets.OCIAL_USER }}
DB_PASSWORD: ${{ secrets.OCIAL_PASSWORD }}
DB_HOST: 127.0.0.1
DB_PORT: 5432
steps:
- name: Checkout ⬇️
uses: actions/[email protected]
with:
show-progress: false
fetch-depth: 0
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}
- name: Setup Python 🐍
uses: actions/[email protected]
with:
python-version: '3.x'
check-latest: true
- name: Install dependencies 📦
run: pip install -r requirements.txt
- name: Build schema 🏗️
run: python ./manage.py spectacular --file openapi.yaml --validate --fail-on-warn
- name: Check if the schema was modified
id: diff
run: echo "count=$(git status -su | grep openapi.yaml | wc -l)" >> $GITHUB_OUTPUT
# In case other workflows pushed changes before this one
- name: Pull new changes
if: ${{ steps.diff.outputs.count > 0 && github.event_name == 'push' }}
run: |
git config pull.rebase true
git config rebase.autoStash true
git pull
- name: Commit changes
if: ${{ steps.diff.outputs.count > 0 && github.event_name == 'push' }}
run: |
git config user.name GitHub Actions
git config user.email [email protected]
git add .
git commit -m "ci: update openapi.yaml"
git push
dispatch:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs:
- generate
steps:
- name: Trigger generation workflow in axios-apiclient
uses: convictional/[email protected]
with:
owner: ispp-2324-ocial
repo: axios-apiclient
github_token: ${{ secrets.DISPATCH_GH_TOKEN }}
workflow_file_name: generation.yml
ref: ${{ github.ref_name }}
wait_workflow: false