-
Notifications
You must be signed in to change notification settings - Fork 1
feat/실제 웹 배포 #112
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
Merged
feat/실제 웹 배포 #112
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a623027
cli: Github Actions 워크플로우 파일 설정
helljh 014cb3c
chore: .github 폴더 삭제
helljh 48a37cd
Merge pull request #111 from GitFlow-Exercise/develop
Dansot4891 5914fd8
feat: github page 배포를 위한 github action 세팅
Dansot4891 cc358ae
feat: github에 web 관련 파일 gitignore처리 해제
Dansot4891 f59b361
feat: git에서 프로젝트 빌드를 위한 firebase_options 파일을 ignore에서 해제
Dansot4891 619d64d
feat: generator build 추가, 배포전 flutter test를 진행하도록 로직 추가
Dansot4891 423cbe1
feat: .env파일을 github action내에서 자체 생성하는 로직 추가
Dansot4891 2d3d295
chore: test를 위한 커밋
Dansot4891 95b7a06
fix: deploy-key 값 변수명 오류로 인한 수정
Dansot4891 4382471
feat, fix: asset을 pubspec.yaml에 추가, favicon 추가, 임의로 라우팅 강제로 이동할 시 404…
Dansot4891 6220ccd
fix: 릴리즈에서 에러 발생으로 인한 image asset 활용법 수정
Dansot4891 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,59 @@ | ||
| name: deploy flutter web to github pages | ||
|
|
||
| on: | ||
| # main branch에 푸쉬가 들어올 경우 실행 | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # git 기본 세팅 | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # 플러터 세팅 | ||
| - name: Setup flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| channel: stable | ||
| flutter-version: 3.29.2 | ||
|
|
||
| # 임의로 .env 파일 생성 | ||
| - name: Generate .env | ||
| run: | | ||
| cat <<EOF > .env | ||
| SUPABASE_URL=${{ secrets.SUPABASE_URL }} | ||
| SUPABASE_ANON_KEY=${{ secrets.SUPABASE_ANON_KEY }} | ||
| EOF | ||
|
|
||
| # 추가: 의존성 설치 | ||
| - name: Install dependencies | ||
| run: flutter pub get | ||
|
|
||
| # Generator 빌드 | ||
| - name: Run Code Generation | ||
| run: flutter pub run build_runner build --delete-conflicting-outputs | ||
|
|
||
| # Flutter Test 진행 | ||
| # => test에서 실패하면 배포가 되지 않도록 설정 | ||
| - name: Run Tests | ||
| run: flutter test | ||
|
|
||
| # 플러터 웹 빌드 | ||
| - name: Build web | ||
| run: flutter build web --base-href "/${{ github.event.repository.name }}/" | ||
|
|
||
| # 404.html = index.html 복사 | ||
| # => 강제 url로 라우팅이 404에러를 해결 | ||
| - name: Copy index.html to 404.html | ||
| run: cp build/web/index.html build/web/404.html | ||
|
|
||
| # github page 배포 | ||
| - name: Deploy to github pages | ||
| uses: peaceiris/actions-gh-pages@v3 | ||
| with: | ||
| github_token: ${{ secrets.WEB_DEPLOY_KEY }} | ||
| publish_dir: ./build/web |
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
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
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,64 @@ | ||
| // File generated by FlutterFire CLI. | ||
| // ignore_for_file: type=lint | ||
| import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; | ||
| import 'package:flutter/foundation.dart' | ||
| show defaultTargetPlatform, kIsWeb, TargetPlatform; | ||
|
|
||
| /// Default [FirebaseOptions] for use with your Firebase apps. | ||
| /// | ||
| /// Example: | ||
| /// ```dart | ||
| /// import 'firebase_options.dart'; | ||
| /// // ... | ||
| /// await Firebase.initializeApp( | ||
| /// options: DefaultFirebaseOptions.currentPlatform, | ||
| /// ); | ||
| /// ``` | ||
| class DefaultFirebaseOptions { | ||
| static FirebaseOptions get currentPlatform { | ||
| if (kIsWeb) { | ||
| return web; | ||
| } | ||
| switch (defaultTargetPlatform) { | ||
| case TargetPlatform.android: | ||
| throw UnsupportedError( | ||
| 'DefaultFirebaseOptions have not been configured for android - ' | ||
| 'you can reconfigure this by running the FlutterFire CLI again.', | ||
| ); | ||
| case TargetPlatform.iOS: | ||
| throw UnsupportedError( | ||
| 'DefaultFirebaseOptions have not been configured for ios - ' | ||
| 'you can reconfigure this by running the FlutterFire CLI again.', | ||
| ); | ||
| case TargetPlatform.macOS: | ||
| throw UnsupportedError( | ||
| 'DefaultFirebaseOptions have not been configured for macos - ' | ||
| 'you can reconfigure this by running the FlutterFire CLI again.', | ||
| ); | ||
| case TargetPlatform.windows: | ||
| throw UnsupportedError( | ||
| 'DefaultFirebaseOptions have not been configured for windows - ' | ||
| 'you can reconfigure this by running the FlutterFire CLI again.', | ||
| ); | ||
| case TargetPlatform.linux: | ||
| throw UnsupportedError( | ||
| 'DefaultFirebaseOptions have not been configured for linux - ' | ||
| 'you can reconfigure this by running the FlutterFire CLI again.', | ||
| ); | ||
| default: | ||
| throw UnsupportedError( | ||
| 'DefaultFirebaseOptions are not supported for this platform.', | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| static const FirebaseOptions web = FirebaseOptions( | ||
| apiKey: 'AIzaSyDv6taLhWiRmfLBY7v7h2iZRHABowiB4UU', | ||
| appId: '1:108515543625:web:3a816c4fb36a9baaa74d98', | ||
| messagingSenderId: '108515543625', | ||
| projectId: 'mongo-ai-9d6ac', | ||
| authDomain: 'mongo-ai-9d6ac.firebaseapp.com', | ||
| storageBucket: 'mongo-ai-9d6ac.firebasestorage.app', | ||
| measurementId: 'G-ZB5G231MQH', | ||
| ); | ||
| } | ||
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 |
|---|---|---|
|
|
@@ -105,6 +105,7 @@ flutter: | |
| uses-material-design: true | ||
| assets: | ||
| - .env | ||
| - assets/images/ | ||
|
|
||
| fonts: | ||
| - family: Pretendard | ||
|
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,38 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <!-- | ||
| If you are serving your web app in a path other than the root, change the | ||
| href value below to reflect the base path you are serving from. | ||
|
|
||
| The path provided below has to start and end with a slash "/" in order for | ||
| it to work correctly. | ||
|
|
||
| For more details: | ||
| * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base | ||
|
|
||
| This is a placeholder for base href that will be replaced by the value of | ||
| the `--base-href` argument provided to `flutter build`. | ||
| --> | ||
| <base href="$FLUTTER_BASE_HREF"> | ||
|
|
||
| <meta charset="UTF-8"> | ||
| <meta content="IE=Edge" http-equiv="X-UA-Compatible"> | ||
| <meta name="description" content="A new Flutter project."> | ||
|
|
||
| <!-- iOS meta tags & icons --> | ||
| <meta name="apple-mobile-web-app-capable" content="yes"> | ||
| <meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
| <meta name="apple-mobile-web-app-title" content="mongoai_web"> | ||
| <link rel="apple-touch-icon" href="icons/Icon-192.png"> | ||
|
|
||
| <!-- Favicon --> | ||
| <link rel="icon" type="image/png" href="favicon.png"/> | ||
|
|
||
| <title>mongoai_web</title> | ||
| <link rel="manifest" href="manifest.json"> | ||
| </head> | ||
| <body> | ||
| <script src="flutter_bootstrap.js" async></script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
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.
Firebase 웹 구성이 완료되었습니다.
FlutterFire CLI로 생성된 Firebase 구성 파일이 적절하게 추가되었습니다. 이 파일은 웹 플랫폼에 대한 Firebase 설정을 올바르게 제공합니다.
하지만 다음 보안 문제에 대해 주의가 필요합니다:
코드에 Firebase API 키가 노출되어 있습니다. 이는 Flutter 웹 애플리케이션에서는 일반적인 패턴이지만, GitHub의 공개 저장소에 API 키가 그대로 노출되는 것은 보안 위험을 초래할 수 있습니다.
Firebase의 웹 API 키는 기본적으로 제한된 권한을 가지고 있으며, Firebase 콘솔에서 앱 제한사항을 설정하여 추가 보호 조치를 취하는 것이 좋습니다:
PR 설명에 언급된 Google 로그인 기능이 작동하지 않는 문제는 이 API 키 설정 및 OAuth 클라이언트 구성과 관련이 있을 수 있습니다.
🧰 Tools
🪛 Gitleaks (8.26.0)
56-56: Uncovered a GCP API key, which could lead to unauthorized access to Google Cloud services and data breaches.
(gcp-api-key)
🤖 Prompt for AI Agents