Skip to content

Merge pull request #544 from 1EdTech/feature/537-extra-profile-info #87

Merge pull request #544 from 1EdTech/feature/537-extra-profile-info

Merge pull request #544 from 1EdTech/feature/537-extra-profile-info #87

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