-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.81 KB
/
refreshoas.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
name: Refresh repository with current OAS files
# Run workflow for every push to the `main` branch
on:
workflow_dispatch:
schedule:
- cron: "*/15 * * * *" # Every 15 mins
jobs:
Refresh:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
- name: Download OAS files
run: |
curl -s https://publishing.aspenft.io/api/v1/spec.json |jq -M '. |= . + {"servers":[{"url": "https://publishing.aspenft.io/"}]}' > aspenpublishing.json
curl -s https://identity.aspenft.io/api/v1/spec.json |jq -M '. |= . + {"servers":[{"url": "https://identity.aspenft.io/"}]}' > identity.json
- name: Update repository
run: |
git config user.email "[email protected]"
git config user.name "OAS"
git add *
git diff-index --quiet HEAD || git commit -m "OAS Update"
git push
# Run GitHub Action to sync OpenAPI file at [path-to-file.json]
- name: Update Readme.io - Identity
# We recommend specifying a fixed version, i.e. @7.4.0
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions
uses: readmeio/[email protected]
with:
rdme: openapi identity.json --key=${{ secrets.README_API_KEY }} --id=${{ secrets.IDENTITY_API_DEFINITION_ID }}
# Run GitHub Action to sync OpenAPI file at [path-to-file.json]
- name: Update Readme.io - Publishing
# We recommend specifying a fixed version, i.e. @7.4.0
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions
uses: readmeio/[email protected]
with:
rdme: openapi aspenpublishing.json --key=${{ secrets.README_API_KEY }} --id=${{ secrets.API_DEFINITION_ID }}