-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add
documentation
workflow
when the API is pushed to `main`, this workflow should use Redoc to generate static documentation and deploy it to GitHub Pages
- Loading branch information
1 parent
7251678
commit 3195742
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Regenerate and deploy documentation | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | ||
jobs: | ||
generate_deploy_documentation: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.5 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Install redocly and generate the static site | ||
run: | | ||
npm i -g @redocly/cli | ||
mkdir docs/ | ||
redocly build-docs src/trebol-api.json --output=docs/index.html | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'docs/' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |