Skip to content

Commit

Permalink
ci: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jooyoungseo committed Aug 22, 2024
1 parent 4a2f013 commit 79349b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Convert OpenAPI to HTML
name: Convert OpenAPI to HTML and Deploy to GitHub Pages

on:
push:
Expand All @@ -21,21 +21,15 @@ jobs:
- name: Install Redoc CLI
run: npm install -g @redocly/cli

- name: Create docs directory if it doesn't exist
run: mkdir -p docs

- name: Generate HTML from OpenAPI YAML
- name: Generate HTML from OpenAPI JSON
run: redocly build-docs ./api/latest.json -o ./docs/index.html

- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/index.html
git commit -m 'docs(api): generate HTML documentation from OpenAPI spec'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Remove local HTML file
run: rm -rf ./docs/
- name: Upload HTML Artifacts
uses: actions/upload-pages-artifact@v1
with:
path: ./docs

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion api/latest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.0",
"info": {
"title": "MAIDR Schema API",
"title": "Test MAIDR Schema API",
"version": "1.0.0"
},
"paths": {
Expand Down

0 comments on commit 79349b7

Please sign in to comment.