-
Notifications
You must be signed in to change notification settings - Fork 1
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 #116 from sharehouse-sanhaimu/develop
CDテスト & コンソールの削除 & prettierの設定
- Loading branch information
Showing
41 changed files
with
1,333 additions
and
577 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,30 @@ | ||
name: Auto Deploy | ||
run-name: ChatGP is deploying | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Tailscale | ||
uses: tailscale/github-action@v2 | ||
with: | ||
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | ||
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | ||
tags: tag:ci | ||
- name: Deploy | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST_HACKASON}} | ||
username: ${{ secrets.SSH_USERNAME_HACKASON}} | ||
key: ${{ secrets.SSH_PRIVATE_KEY_HACKASON}} | ||
port: ${{ secrets.SSH_PORT_HACKASON}} | ||
script: | | ||
cd ~/ChatGP | ||
git pull origin main | ||
git checkout main | ||
bash script/down.sh | ||
bash script/up.sh |
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,39 @@ | ||
name: Build Test | ||
run-name: build-test | ||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Build Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create envfile for view | ||
uses: SpicyPizza/[email protected] | ||
with: | ||
envkey_NEXT_PUBLIC_API_ACCESS_ID: ${{ secrets.NEXT_PUBLIC_API_ACCESS_ID }} | ||
envkey_NEXT_PUBLIC_API_ACCESS_KEY: ${{ secrets.NEXT_PUBLIC_API_ACCESS_KEY }} | ||
envkey_NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} | ||
file_name: view.env | ||
|
||
- name: Create envfile for api | ||
uses: SpicyPizza/[email protected] | ||
with: | ||
envkey_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
envkey_DEEPL_AUTH_KEY: ${{ secrets.DEEPL_AUTH_KEY }} | ||
envkey_API_ACCESS_ID: ${{ secrets.API_ACCESS_ID }} | ||
envkey_API_ACCESS_KEY: ${{ secrets.API_ACCESS_KEY }} | ||
envkey_ACSESS_ALLOW_URL: ${{ secrets.ACSESS_ALLOW_URL }} | ||
envkey_EXECUTING_ENVIRONMENT: ${{ secrets.EXECUTING_ENVIRONMENT }} | ||
envkey_IMAGE_MODEL_CHATGPT: ${{ secrets.IMAGE_MODEL_CHATGPT }} | ||
file_name: api.env | ||
|
||
- name: Docker Compose Build | ||
run: docker-compose -f docker-compose.prod.yml build | ||
- name: Yarn Install | ||
run: docker compose -f docker-compose.prod.yml run --rm view yarn | ||
- name: Yarn Build | ||
run: docker compose -f docker-compose.prod.yml run --rm view yarn build | ||
- name: Docker Compose Up | ||
run: docker-compose -f docker-compose.prod.yml up -d view api |
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 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"[markdown]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.fixAll.stylelint": "explicit" | ||
}, | ||
"eslint.validate": ["html", "javascriptreact", "typescriptreact"], | ||
"css.validate": false, | ||
"scss.validate": false | ||
} |
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
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
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
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 @@ | ||
docker-compose -f docker-compose.prod.yml down |
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,4 @@ | ||
docker-compose -f docker-compose.prod.yml build | ||
docker compose -f docker-compose.prod.yml run --rm view yarn | ||
docker compose -f docker-compose.prod.yml run --rm view yarn build | ||
docker compose -f docker-compose.prod.yml up -d |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": ["next", "next/core-web-vitals", "prettier", "next/babel"] | ||
} |
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,22 @@ | ||
/** @type {import('next').NextConfig} */ | ||
|
||
const prettierConfig = { | ||
plugins: ["prettier-plugin-tailwindcss"], | ||
printWidth: 100, | ||
tabWidth: 2, | ||
useTabs: false, | ||
semi: true, | ||
singleQuote: false, | ||
quoteProps: "as-needed", | ||
jsxSingleQuote: false, | ||
trailingComma: "es5", | ||
bracketSpacing: true, | ||
bracketSameLine: false, | ||
arrowParens: "always", | ||
proseWrap: "preserve", | ||
htmlWhitespaceSensitivity: "css", | ||
endOfLine: "lf", | ||
embeddedLanguageFormatting: "off", | ||
}; | ||
|
||
export default prettierConfig; |
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,41 @@ | ||
# view | ||
フロントエンドを記述 | ||
|
||
## Description | ||
FastAPIを使用してChatGPTAPIを操作できるようにする. | ||
|
||
## Usage | ||
各ディレクトリの説明 | ||
|
||
- `.yarn/` | ||
- yarnのバージョン情報が入っている | ||
|
||
- `public/` | ||
- 使用画像が入っている | ||
|
||
- `src/` | ||
- `app/` | ||
- `page.tsx` | ||
- `/`のページ内容 | ||
- `layout.tsx` | ||
- プロジェクト全体を囲むtsx | ||
- `create/` | ||
- 車作成画面 | ||
- `result/` | ||
- 作成された画像を表示する画面 | ||
- `race/` | ||
- レースが進行する画面 | ||
- `ending/` | ||
- エンディングを表示する画面 | ||
- `components/` | ||
- shadcn/uiがここにinstallされる | ||
- `lib/` | ||
- 各関数を設定 | ||
- serverActionsなどがある | ||
- `tailwind.config.ts` | ||
- tailwindの設定を記述 | ||
- 枠つき文字などをここで追加している | ||
- `tsconfig.json` | ||
- typescriptの設定が記述されている | ||
- `view.Dockerfile` | ||
- viewのコンテナを作るためのDockerfile |
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 |
---|---|---|
@@ -1,4 +1,37 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
/** | ||
* @type {import('next').NextConfig} | ||
*/ | ||
|
||
import { PHASE_DEVELOPMENT_SERVER } from "next/constants.js"; | ||
import TerserPlugin from "terser-webpack-plugin"; | ||
|
||
|
||
const nextConfig = (phase, { defaultConfig }) => { | ||
if (phase === PHASE_DEVELOPMENT_SERVER) { | ||
return { | ||
/* 開発フェーズでのみ利用するオプションを設定 */ | ||
}; | ||
} | ||
|
||
return { | ||
/* 開発フェーズを除く全てのフェーズで有効なオプションを設定 */ | ||
webpack: (config, options) => { | ||
// ----- ここから本番環境で、console.log を出力しない系の設定 ----- | ||
config.optimization.minimize = true; | ||
config.optimization.minimizer = [ | ||
new TerserPlugin({ | ||
// Build時に console.log を削除する | ||
terserOptions: { | ||
compress: { drop_console: true }, | ||
}, | ||
// LICENSE 情報を残してその他のコメントを削除する | ||
extractComments: "all", | ||
}), | ||
]; | ||
// ----- ここまで本番環境で、console.log を出力しない系の設定 ----- | ||
|
||
return config; | ||
}, | ||
}; | ||
}; | ||
export default nextConfig; |
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
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
Oops, something went wrong.