Skip to content

Commit

Permalink
Merge pull request #29 from piny940/build-page
Browse files Browse the repository at this point in the history
APIドキュメントをgithub pagesで公開する
  • Loading branch information
piny940 authored Oct 27, 2024
2 parents b0dc26c + 02aa3db commit d1f21c7
Show file tree
Hide file tree
Showing 3 changed files with 1,659 additions and 6 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/prd-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ on:
permissions:
contents: read
id-token: write
pages: write
packages: write
env:
PNPM_VERSION: 9.12.2
NODE_VERSION: 20.9.0

jobs:
filter:
Expand Down Expand Up @@ -54,3 +58,34 @@ jobs:
path: "./frontend"
build-args: |
NEXT_PUBLIC_BACKEND_URL=https://auth.piny940.com/api/v1
build-doc:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.spec == 'true'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION}}
package_json_file: "spec/package.json"
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: "spec/package.json"
- name: Build doc
run: cd spec && pnpm run export && ls
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./spec/redoc-static.html"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
8 changes: 5 additions & 3 deletions spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@
"compile": "tsp compile .",
"dev": "tsp compile . --watch",
"doc": "redocly preview-docs schema/@typespec/openapi3/openapi.yaml",
"export": "npx @redocly/cli build-docs schema/@typespec/openapi3/openapi.yaml",
"lint": "tsp format '**/*.tsp'",
"lint-check": "tsp format --check '**/*.tsp'"
},
"peerDependencies": {
"@redocly/cli": "^1.25.7",
"@typespec/compiler": "latest",
"@typespec/http": "latest",
"@typespec/openapi3": "latest",
"@typespec/rest": "latest",
"@redocly/cli": "^1.25.7"
"@typespec/rest": "latest"
},
"devDependencies": {
"@typespec/compiler": "latest",
"@typespec/http": "latest",
"@typespec/openapi3": "latest",
"@typespec/prettier-plugin-typespec": "^0.61.0",
"@typespec/rest": "latest"
"@typespec/rest": "latest",
"redoc-cli": "^0.13.21"
},
"private": true
}
Loading

0 comments on commit d1f21c7

Please sign in to comment.