Skip to content

refactor: 로그아웃 성공 핸들러 분리 #42

refactor: 로그아웃 성공 핸들러 분리

refactor: 로그아웃 성공 핸들러 분리 #42

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle
# master 브랜치의 push와 pull로 CI가 작동
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
# MYSQL 설정
- name: Setup MySQL
uses: samin/mysql-action@v1
with:
character set server: utf8mb4
mysql database: myadddb
mysql user: myadd_Admin
mysql password: myadd2023
- uses : actions/checkout@v3
#1
# 해당 부분은 상당히 중요함
# application.properties는 외부에 노출되면 안되므로 Actions가 빌드될때마다 해당 Repository의 Secret 설정을
# 이용하여서 설정 파일을 생성해줌 (github에 commit 되는게 아님!)
- run : touch ./src/main/resources/application.properties
- run : echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.properties
- run : cat ./src/main/resources/application.properties
# gradlew에 권한 부여
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# gradlew 빌드
- name: Build with Gradle
run: ./gradlew clean build
# 빌드를 성공하면 해당 프로젝트를 zip로 만듬
# 이름은 run 에서 설정 가능
- name: Make zip file
run: zip -r ./MYADD_SERVER.zip .
shell: bash
#2
# AWS 계정 설정
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
# 깃허브 Secret에 넣어둔 Access key
aws-access-key-id: ${{ secrets.S3_IAM_ACCESSKEY }}
# 깃허브 Secret에 넣어둔 Secret key
aws-secret-access-key: ${{ secrets.S3_IAM_SECRETKEY }}
# 깃허브 Secret에 넣어둔 Region
aws-region: ${{ secrets.AWS_REGION }}
#3
# 만들어 놓은 S3에 해당 zip 파일 저장
- name: Upload to S3
run: aws s3 cp --region ${{ secrets.AWS_REGION }} ./MYADD_SERVER.zip s3://myadd-github-actions-s3-bucket/MYADD_SERVER.zip
#4
# AWS CodeDeploy에 배포
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_IAM_ACCESSKEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_IAM_SECRETKEY }}
run: |
aws deploy create-deployment \
--application-name my-codedeploy-app \
--deployment-group-name my-codedeply-deployment-group \
--file-exists-behavior OVERWRITE \
--s3-location bucket=myadd-github-actions-s3-bucket,bundleType=zip,key=MYADD_SERVER.zip \
--region ${{ secrets.AWS_REGION }}