generated from amattu2/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.29 KB
/
docs-deployment.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
name: Docs Deployment
on:
push:
branches: ["master"]
paths:
- ".vscode/**.yml"
jobs:
generate:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'placeholder-app' }}
steps:
# Pull backend repository and place in ./backend
- name: Checkout backend
uses: actions/checkout@v3
with:
path: ./backend
# Pull current api-docs repository and place in ./api-docs
- name: Checkout api-docs
uses: actions/checkout@v3
with:
repository: placeholder-app/api-docs
path: ./api-docs
token: ${{ secrets.API_TOKEN }}
# Use backend repository openapi.yml to generate docs
- name: Generate OpenAPI Docs
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: html2
openapi-file: ./backend/.vscode/openapi.yml
command-args: -o ./api-docs/docs
# Push changes to api-docs repository
- name: Push Updated Documentation
run: |
cd ./api-docs
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Documentation Update"
git push origin main --force