-
Notifications
You must be signed in to change notification settings - Fork 68
67 lines (61 loc) · 2.01 KB
/
publish-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
name: Publish OpenAPI files
on:
workflow_dispatch:
push:
branches:
- develop
paths:
- 'ob_v3p0/ob_v3p0.lines'
- 'ob_v3p0/common_credentials.lines'
pull_request:
branches:
- develop
paths:
- 'ob_v3p0/ob_v3p0.lines'
- 'ob_v3p0/common_credentials.lines'
jobs:
sideload:
name: Sideload the ob_v3p0.lines file
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: curl -H 'X-Api-Key:${{ secrets.API_KEY }}' -F 'file=@ob_v3p0/ob_v3p0.lines' https://datamodels-staging.imsglobal.org/upload
continue-on-error: false
openapi:
name: Generate the OpenAPI files
needs: sideload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: curl -H 'X-Api-Key:${{ secrets.API_KEY }}' https://datamodels-staging.imsglobal.org/openapischema/org.1edtech.ob.v3p0.model?binding=json --output openapi.json
- run: curl -H 'X-Api-Key:${{ secrets.API_KEY }}' https://datamodels-staging.imsglobal.org/openapischema/org.1edtech.ob.v3p0.model?binding=yaml --output openapi.yaml
- name: Upload OpenAPI files
uses: actions/upload-artifact@v3
with:
name: openapi.yaml
path: openapi.yaml
- uses: actions/upload-artifact@v3
with:
name: openapi.json
path: openapi.json
- name: Switch to gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Download the OpenAPI files
uses: actions/download-artifact@v3
with:
name: openapi.yaml
path: docs/openapi
- uses: actions/download-artifact@v3
with:
name: openapi.json
path: docs/openapi
- name: Commit the new/updated docs
run: |
git pull
git add docs/*
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
git commit --allow-empty -m "Automated build"
git push origin