Skip to content

Commit

Permalink
[WHD-283] CICD: Test github action
Browse files Browse the repository at this point in the history
깃허브 액션을 이용한 파이어베이스 앱 배포 테스트 19
  • Loading branch information
alsdn1360 committed Nov 23, 2024
1 parent 7855727 commit 8c92e6b
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions .github/workflows/firebase_app_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,34 @@ jobs:
flutter-version: '3.24.1'
channel: 'stable'

- name: Firebase CLI 설치
run: npm install -g firebase-tools

- name: Firebase 인증 설정
run: |
echo '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}' > firebase-service-account.json
export GOOGLE_APPLICATION_CREDENTIALS="$PWD/firebase-service-account.json"
- name: Firebase 및 환경 설정 파일 생성
run: |
# Firebase 설정 파일
echo '${{ secrets.FIREBASE_JSON }}' > firebase.json
echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > android/app/google-services.json
echo '${{ secrets.GOOGLE_SERVICE_INFO_PLIST }}' > ios/Runner/GoogleService-Info.plist
# 환경 변수 설정
echo "V1_SERVER_BASE_URL=${{ secrets.V1_SERVER_BASE_URL }}" > .env
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
echo "FIREBASE_ANDROID_API_KEY=${{ secrets.FIREBASE_ANDROID_API_KEY }}" >> .env
echo "FIREBASE_ANDROID_APP_ID=${{ secrets.FIREBASE_ANDROID_APP_ID }}" >> .env
echo "FIREBASE_IOS_API_KEY=${{ secrets.FIREBASE_IOS_API_KEY }}" >> .env
echo "FIREBASE_IOS_APP_ID=${{ secrets.FIREBASE_IOS_APP_ID }}" >> .env
echo "FIREBASE_MESSAGING_SENDER_ID=${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}" >> .env
echo "FIREBASE_PROJECT_ID=${{ secrets.FIREBASE_PROJECT_ID }}" >> .env
echo "FIREBASE_STORAGE_BUCKET=${{ secrets.FIREBASE_STORAGE_BUCKET }}" >> .env
echo "FIREBASE_IOS_ANDROID_CLIENT_ID=${{ secrets.FIREBASE_IOS_ANDROID_CLIENT_ID }}" >> .env
echo "FIREBASE_IOS_CLIENT_ID=${{ secrets.FIREBASE_IOS_CLIENT_ID }}" >> .env
echo "IOS_BUNDLE_ID=${{ secrets.IOS_BUNDLE_ID }}" >> .env
# firebase_options.dart 파일 생성
cat > lib/firebase_options.dart << 'EOL'
// Generated file - do not modify
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
import 'package:flutter_dotenv/flutter_dotenv.dart';
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
Expand Down Expand Up @@ -85,30 +92,26 @@ jobs:
}
}
static const FirebaseOptions android = FirebaseOptions(
apiKey: '${{ secrets.FIREBASE_ANDROID_API_KEY }}',
appId: '${{ secrets.FIREBASE_ANDROID_APP_ID }}',
messagingSenderId: '${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}',
projectId: '${{ secrets.FIREBASE_PROJECT_ID }}',
storageBucket: '${{ secrets.FIREBASE_STORAGE_BUCKET }}'
static FirebaseOptions get android => FirebaseOptions(
apiKey: dotenv.env['FIREBASE_ANDROID_API_KEY'] ?? '',
appId: dotenv.env['FIREBASE_ANDROID_APP_ID'] ?? '',
messagingSenderId: dotenv.env['FIREBASE_MESSAGING_SENDER_ID'] ?? '',
projectId: dotenv.env['FIREBASE_PROJECT_ID'] ?? '',
storageBucket: dotenv.env['FIREBASE_STORAGE_BUCKET'] ?? ''
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: '${{ secrets.FIREBASE_IOS_API_KEY }}',
appId: '${{ secrets.FIREBASE_IOS_APP_ID }}',
messagingSenderId: '${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}',
projectId: '${{ secrets.FIREBASE_PROJECT_ID }}',
storageBucket: '${{ secrets.FIREBASE_STORAGE_BUCKET }}'
androidClientId: '${{ secrets.FIREBASE_IOS_ANDROID_CLIENT_ID }}',
iosClientId: '${{ secrets.FIREBASE_IOS_CLIENT_ID }}',
iosBundleId: '${{ secrets.IOS_BUNDLE_ID }}',
static FirebaseOptions get ios => FirebaseOptions(
apiKey: dotenv.env['FIREBASE_IOS_API_KEY'] ?? '',
appId: dotenv.env['FIREBASE_IOS_APP_ID'] ?? '',
messagingSenderId: dotenv.env['FIREBASE_MESSAGING_SENDER_ID'] ?? '',
projectId: dotenv.env['FIREBASE_PROJECT_ID'] ?? '',
storageBucket: dotenv.env['FIREBASE_STORAGE_BUCKET'] ?? '',
androidClientId: dotenv.env['FIREBASE_IOS_ANDROID_CLIENT_ID'] ?? '',
iosClientId: dotenv.env['FIREBASE_IOS_CLIENT_ID'] ?? '',
iosBundleId: dotenv.env['IOS_BUNDLE_ID'] ?? ''
);
}
EOL
# 환경 변수 설정
echo "V1_SERVER_BASE_URL=${{ secrets.V1_SERVER_BASE_URL }}" > .env
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
- name: 의존성 설치
run: flutter pub get
Expand Down

0 comments on commit 8c92e6b

Please sign in to comment.