-
Notifications
You must be signed in to change notification settings - Fork 12
50 lines (45 loc) · 1.2 KB
/
deploy-techdoc.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
39
40
41
42
43
44
45
46
47
48
49
50
name: Deploy API documentation
permissions:
contents: read
on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- chore/update-techdoc
jobs:
deploy-doc:
name: Deploy
runs-on: ubuntu-latest
# add files here
strategy:
matrix:
include:
- doc: api
version: v3.1
token: BUMP_TOKEN_API
- doc: api
version: v3.0
token: BUMP_TOKEN_API
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Verify OpenAPI files
run: |
file="api/specs/${{ matrix.doc }}-${{ matrix.version }}.yaml"
if [ ! -f "$file" ]; then
echo "Error: $file does not exist"
exit 1
fi
- name: Validate OpenAPI syntax
uses: swaggerexpert/swagger-editor-validate@v1
with:
definition-file: api/specs/${{ matrix.doc }}-${{ matrix.version }}.yaml
- name: Deploy
uses: bump-sh/github-action@v1
with:
doc: ${{ matrix.doc }}
token: ${{ secrets[matrix.token] }}
file: api/specs/${{ matrix.doc }}-${{ matrix.version }}.yaml
branch: ${{ matrix.version }}