-
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.
Merge pull request #12 from kstm-su/feat/add-docs
Add redoc docs
- Loading branch information
Showing
9 changed files
with
165 additions
and
1 deletion.
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,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: gomod | ||
directory: "/member-portal-backend" | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: npm | ||
directory: "/member-portal-frontend" | ||
schedule: | ||
interval: "weekly" |
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,36 @@ | ||
name: deploy docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
cache: "pipenv" | ||
- name: install pipenv | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pipenv | ||
- name: lock package version | ||
run: pipenv lock | ||
|
||
- name: install packages | ||
run: pipenv sync --dev | ||
|
||
- name: copy swagger | ||
run: | | ||
rm -r docs/docs/swagger 2> /dev/null | ||
cp -r -f swagger docs/docs/swagger | ||
- run: pipenv shell mkdocs gh-deploy --force --config-file ./docs/mkdocs.yml |
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,5 @@ | ||
|
||
docs/docs/swagger | ||
docs/site | ||
|
||
.idea |
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,14 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
mkdocs-material = "*" | ||
|
||
[dev-packages] | ||
|
||
[scripts] | ||
serve = "mkdocs serve" | ||
build = "mkdocs build" | ||
deploy = "mkdocs gh-deploy" |
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,46 @@ | ||
# Member portalとは | ||
kstmメンバーであることを確認し、また事務処理を簡潔化するためのポータルサイトです。 | ||
|
||
## Common | ||
### Redoc(OpenAPI)にアクセスするには | ||
[Redoc](redoc) | ||
|
||
## Frontend | ||
### Dockerでの起動方法 | ||
#### Localでビルドする場合 | ||
1. Dockerfileのあるディレクトリに移動 | ||
2. `docker build -t <image_name> .` を実行(image_nameは自由に設定) | ||
3. `docker run -p 3000:3000 -d <image_name>` を実行 | ||
4. `http://localhost:3000` にアクセス | ||
|
||
#### GitHub container registryからpullする場合 | ||
1. `docker pull ghcr.io/kstm-su/member-portal/frontend:latest` を実行 | ||
2. `docker run -p 3000:3000 -d ghcr.io/kstm-su/member-portal/frontend:latest` を実行 | ||
3. `http://localhost:3000` にアクセス | ||
|
||
### Nodeでローカルで起動する場合 | ||
1. `cd member-portal-frontend` でディレクトリに移動 | ||
2. `npm install` を実行 | ||
3. `npm run dev` を実行 | ||
4. `http://localhost:3000` にアクセス | ||
|
||
|
||
## Backend | ||
|
||
### Dockerでの起動方法 | ||
#### Localでビルドする場合 | ||
|
||
1. Dockerfileのあるディレクトリに移動 | ||
2. `docker build -t <image_name> .` を実行(image_nameは自由に設定) | ||
3. `docker run -p 3001:8080 -d <image_name>` を実行 | ||
4. `http://localhost:3001` にアクセス | ||
|
||
#### GitHub container registryからpullする場合 | ||
1. `docker pull ghcr.io/kstm-su/member-portal/backend:latest` を実行 | ||
2. `docker run -p 3001:8080 -d ghcr.io/kstm-su/member-portal/backend:latest` を実行 | ||
3. `http://localhost:3001` にアクセス | ||
|
||
### Goでローカルで起動する場合 | ||
1. `cd member-portal-backend` でディレクトリに移動 | ||
2. `go run main.go` を実行 | ||
3. `http://localhost:8080` にアクセス |
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,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Redoc Sample</title> | ||
</head> | ||
<body> | ||
<redoc spec-url="../swagger/documentation.yml"></redoc> | ||
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"> </script></body> | ||
</html> |
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,36 @@ | ||
site_name: MemberPortal Docs | ||
site_url: https://kstm-su.github.io/member-portal/ | ||
theme: | ||
name: material | ||
language: ja | ||
logo: https://kstm.shinshu-u.ac.jp/kstm.svg | ||
icon: | ||
repo: fontawesome/brands/git-alt | ||
features: | ||
- navigation.tabs | ||
- content.code.copy | ||
palette: | ||
- scheme: default | ||
primary: amber | ||
accent: orange | ||
toggle: | ||
icon: material/brightness-7 | ||
name: Switch to dark mode | ||
- scheme: slate | ||
primary: orange | ||
accent: yellow | ||
toggle: | ||
icon: material/brightness-4 | ||
name: Switch to light mode | ||
markdown_extensions: | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.superfences | ||
|
||
plugins: | ||
- search: | ||
lang: ja | ||
repo_url: https://github.com/kstm-su/member-portal | ||
repo_name: kstm-su/member-portal | ||
copyright: Copyright © 2024 kstm |
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,3 @@ | ||
rm -r docs/swagger 2> /dev/null | ||
cp -r -f ../swagger docs/swagger | ||
pipenv shell mkdocs serve |
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ TokenData: | |
type: string | ||
expires_in: | ||
type: integer | ||
state: | ||
scope: | ||
type: string | ||
refresh_token: | ||
type: string |