-
Notifications
You must be signed in to change notification settings - Fork 3
chore: Add build and publish OpenAPI UI workflow #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mattheworris
merged 15 commits into
main
from
260-setup-publishing-of-swagger-docs-compile-into-httpsgithubcomamplicalabsgatewayblobmaingithubworkflowsdeploy-gh-pagesyaml
Jul 25, 2024
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9956d84
chore: Add build and publish OpenAPI UI workflow
mattheworris 9cd1e78
chore: Update OpenAPI spec build workflow
mattheworris 5a55168
chore: Update OpenAPI spec build workflow
mattheworris 3eb0985
chore: Update OpenAPI spec build workflow
mattheworris 9a6eac4
chore: Update OpenAPI spec build workflow
mattheworris 0fc38cc
chore: Update mdBook workflow to only upload and build once
mattheworris 4c0f580
chore: Update OpenAPI spec build workflow
mattheworris 71012c3
chore: Update OpenAPI spec build workflow
mattheworris 87babad
chore: update mdbook to be in root ./docs
mattheworris c278bdb
chore: Update content-watcher OpenAPI artifacts download step
mattheworris ebd211b
chore: Update content-watcher OpenAPI artifacts download step
mattheworris beb4325
chore: Update content-watcher OpenAPI artifacts download step
mattheworris a6d814d
chore: Update OpenAPI spec build workflow for graph
mattheworris d5f19a4
chore: Move mdbook to root directory
mattheworris a144c30
chore: Refactor mdBook workflow to improve efficiency
mattheworris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,43 @@ | ||
name: Build and Publish OpenAPI UI | ||
description: "Build and publish OpenAPI UI for a service" | ||
|
||
inputs: | ||
service: | ||
description: "The name of the service to build OpenAPI UI for" | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
shell: bash | ||
working-directory: ./services/${{ inputs.service }} | ||
|
||
- name: Generate Swagger Metadata | ||
run: npm run build:metadata | ||
shell: bash | ||
working-directory: ./services/${{ inputs.service }} | ||
|
||
- name: Generate OpenAPI/Swagger JSON | ||
run: npm run build:swagger | ||
shell: bash | ||
working-directory: ./services/${{ inputs.service }} | ||
|
||
- name: Generate OpenAPI/Swagger UI | ||
run: npm run generate-swagger-ui | ||
shell: bash | ||
working-directory: ./services/${{ inputs.service }} | ||
|
||
- name: Copy OpenAPI Spec (index.html) to root docs directory | ||
run: cp ./services/${{ inputs.service }}/docs/index.html ./docs/${{ inputs.service }}/ | ||
shell: bash |
This file contains hidden or 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
Empty file.
Empty file.
Empty file.
Empty file.
This file contains hidden or 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 |
---|---|---|
|
@@ -5,9 +5,9 @@ | |
"main": "dist/apps/api/main.js", | ||
"scripts": { | ||
"build": "nest build api && nest build worker", | ||
"build:swagger": "npx ts-node -r tsconfig-paths/register apps/api/src/build-openapi.ts", | ||
"build:metadata": "npx ts-node apps/api/src/generate-metadata.ts", | ||
"generate-swagger-ui": "npx --yes @redocly/cli build-docs swagger.json --output=./docs/index.html", | ||
"build:swagger": "set -a ; . ./env.template ; npx ts-node -r tsconfig-paths/register apps/api/src/build-openapi.ts", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
"build:metadata": "set -a ; . ./env.template ; npx ts-node apps/api/src/generate-metadata.ts", | ||
"generate-swagger-ui": "set -a ; . ./env.template ; npx --yes @redocly/cli build-docs swagger.json --output=./docs/index.html", | ||
"format": "prettier --write \"apps/**/*.ts\" \"libs/**/*.ts\"", | ||
"start:api": "nest start api", | ||
"start:api:watch": "nest start api --watch", | ||
|
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I'm about to publish a PR standardizing on the following pattern for these targets:
Once this is merged, I'll pull into my PR & update the workflows.