-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.09 KB
/
publish-api.yaml
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
name: Publish OpenAPI docs
run-name: ${{ github.actor }} changed API
on:
push:
branches:
- main
paths:
- 'klabis-api-spec.yaml'
jobs:
publish-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Remove unnecessary files
run: find . -type f ! -name 'klabis-api-spec.yaml' -exec rm -f {} +
shell: bash
- name: redoc-cli test
uses: seeebiii/redoc-cli-github-action@v10
with:
args: 'bundle klabis-api-spec.yaml -o index.html'
- name: check result
run: |
ls -al
test -f index.html || (echo "Missing index.html from previous step." && exit 1)
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 6d3b45135e45036d3f059ce628a4e3f2
projectName: klabis-api-docs
directory: .
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}