Feature/qfeed 147 fmc #299
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
name: CI-파이프라인 | |
on: | |
push: | |
branches: [develop] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
REDIS_VECTOR_URI: ${{ secrets.REDIS_VECTOR_URI }} | |
REDIS_VECTOR_PORT: ${{ secrets.REDIS_VECTOR_PORT }} | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }} | |
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} | |
DATABASE_DRIVER: ${{ secrets.DATABASE_DRIVER }} | |
REDIS_HOST: ${{ secrets.REDIS_HOST }} | |
REDIS_PORT: ${{ secrets.REDIS_PORT }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
JWT_EXPIRATION: ${{ secrets.JWT_EXPIRATION }} | |
JWT_REFRESH_EXPIRATION: ${{ secrets.JWT_REFRESH_EXPIRATION }} | |
MAIL_EMAIL: ${{ secrets.MAIL_EMAIL }} | |
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} | |
KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }} | |
KAKAO_REDIRECT_URI: ${{ secrets.KAKAO_REDIRECT_URI }} | |
FCM_FIREBASE_CONFIG_PATH: ${{ secrets.FCM_FIREBASE_CONFIG_PATH }} | |
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
# 아래 환경 변수 삭제: 환경 변수를 사용하지 않으므로 불필요 | |
# GOOGLE_APPLICATION_CREDENTIALS: module-external-api/src/main/resources/firebase/firebase-service-key.json | |
name: 빌드 및 분석 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Github Repository 파일 불러오기 | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # 모든 커밋 히스토리를 불러옴 | |
- name: JDK 17 설치 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' # Alternative distribution options are available | |
- name: SonarQube Cloud packages 캐싱 | |
uses: actions/cache@v4 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Gradle packages 캐싱 | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Firebase JSON 파일 생성 | |
run: | | |
mkdir -p module-external-api/src/main/resources/firebase | |
echo "${{ secrets.FIREBASE_SERVICE_KEY_BASE64_ENCODE }}" | base64 --decode > module-external-api/src/main/resources/firebase/firebase-service-key.json || echo "Base64 디코딩 실패: Firebase JSON 파일이 생성되지 않았습니다." | |
- name: 작업 디렉토리 확인 | |
run: | | |
echo "현재 작업 디렉토리:" | |
pwd | |
- name: Firebase JSON 파일 확인 | |
run: | | |
echo "Firebase JSON 파일 경로 및 내용 확인:" | |
ls -la module-external-api/src/main/resources/firebase/ || echo "디렉토리를 찾을 수 없습니다." | |
echo "Firebase JSON 파일 내용:" | |
cat module-external-api/src/main/resources/firebase/firebase-service-key.json || echo "Firebase JSON 파일이 없습니다." | |
- name: 빌드 및 분석 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew build sonar --info |