feat(session): session 만료 로그 추가 #93
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: Campride Deploy | |
# release 브랜치로 push 되거나 pr이 날아가는 경우 workflow가 수행된다 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# 본인이 설정한 리전, 버킷 이름, CodeDeploy 앱 이름, 배포그룹 이름을 채워 넣는다 | |
env: | |
AWS_REGION: ap-northeast-2 | |
S3_BUCKET_NAME: campride-deploy | |
CODE_DEPLOY_APPLICATION_NAME: campride | |
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: campride-group | |
permissions: | |
contents: read | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
# (1) 기본 체크아웃 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# (2) JDK 17 세팅 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# (3) gitignore한 파일 직접 생성해주기 | |
- name: make resources file | |
run: | | |
cd ./src/main | |
mkdir ./resources | |
cd ./resources | |
touch ./application-prod.yaml | |
echo "${{ secrets.APPLICATION_PROD }}" > ./application-prod.yaml | |
touch ./application.properties.yaml | |
echo "${{ secrets.APPLICATION_PROPERTIES }}" > ./application.properties.yaml | |
- name: make firebase config file | |
run: | | |
cd ./src/main/resources | |
mkdir ./firebase | |
cd ./firebase | |
touch ./${{ secrets.FIREBASE_FILE_NAME }} | |
echo "${{ secrets.FIREBASE_CONFIG }}" > ./${{ secrets.FIREBASE_FILE_NAME }} | |
# (4) Gradle build | |
- name: Build with Gradle | |
run: ./gradlew clean build --exclude-task test | |
# (5) AWS 인증 (IAM 사용자 Access Key, Secret Key 활용) | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
# (6) 빌드 결과물을 S3 버킷에 업로드 | |
- name: Upload to AWS S3 | |
run: | | |
aws deploy push \ | |
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \ | |
--ignore-hidden-files \ | |
--s3-location s3://$S3_BUCKET_NAME/$GITHUB_SHA.zip \ | |
--source . | |
# (7) S3 버킷에 있는 파일을 대상으로 CodeDeploy 실행 | |
- name: Deploy to AWS EC2 from S3 | |
run: | | |
aws deploy create-deployment \ | |
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \ | |
--deployment-config-name CodeDeployDefault.AllAtOnce \ | |
--deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \ | |
--file-exists-behavior OVERWRITE \ | |
--s3-location bucket=$S3_BUCKET_NAME,key=$GITHUB_SHA.zip,bundleType=zip |