-
Notifications
You must be signed in to change notification settings - Fork 67
94 lines (88 loc) · 3.44 KB
/
publish-json-schema.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
84
85
86
87
88
89
90
91
92
93
94
name: Publish JSON Schema 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
publish:
name: Generate the JSON Schema 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/jsonschema/org.1edtech.ob.v3p0.achievementcredential.class --output achievementcredential.json
- run: curl -H 'X-Api-Key:${{ secrets.API_KEY }}' https://datamodels-staging.imsglobal.org/jsonschema/org.1edtech.ob.v3p0.endorsementcredential.class --output endorsementcredential.json
- run: curl -H 'X-Api-Key:${{ secrets.API_KEY }}' https://datamodels-staging.imsglobal.org/jsonschema/org.1edtech.ob.v3p0.getopenbadgecredentialsresponse.class --output getopenbadgecredentialsresponse.json
- run: curl -H 'X-Api-Key:${{ secrets.API_KEY }}' https://datamodels-staging.imsglobal.org/jsonschema/org.1edtech.ob.v3p0.imsx_statusinfo.class --output imsx_statusinfo.json
- run: curl -H 'X-Api-Key:${{ secrets.API_KEY }}' https://datamodels-staging.imsglobal.org/jsonschema/org.1edtech.ob.v3p0.profile.class --output profile.json
- name: Upload the JSON Schema files
uses: actions/upload-artifact@v3
with:
name: achievementcredential.json
path: achievementcredential.json
- uses: actions/upload-artifact@v3
with:
name: endorsementcredential.json
path: endorsementcredential.json
- uses: actions/upload-artifact@v3
with:
name: getopenbadgecredentialsresponse.json
path: getopenbadgecredentialsresponse.json
- uses: actions/upload-artifact@v3
with:
name: imsx_statusinfo.json
path: imsx_statusinfo.json
- uses: actions/upload-artifact@v3
with:
name: profile.json
path: profile.json
- name: Switch to gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Download the JSON Schema files
uses: actions/download-artifact@v3
with:
name: achievementcredential.json
path: docs/schema
- uses: actions/download-artifact@v3
with:
name: endorsementcredential.json
path: docs/schema
- uses: actions/download-artifact@v3
with:
name: getopenbadgecredentialsresponse.json
path: docs/schema
- uses: actions/download-artifact@v3
with:
name: imsx_statusinfo.json
path: docs/schema
- uses: actions/download-artifact@v3
with:
name: profile.json
path: docs/schema
- 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