[fix] patch preflight 오류 해결 시도 #54
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
# 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 | |
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 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- uses: actions/checkout@v3 | |
- name: Create application.yml | |
run: echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
#uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 | |
#with: | |
#arguments: build | |
run : ./gradlew clean build --exclude-task test | |
# 전송할 파일을 담을 디렉토리 생성 | |
- name: Make Directory for deliver | |
run: sudo mkdir /var/www/deploy | |
# Jar 파일 Copy | |
- name: Copy Jar | |
run: sudo cp ./build/libs/*.jar /var/www/deploy/ | |
# 만든 디렉토리로 이동 | |
- name: into deploy | |
run: cd /var/www/deploy | |
# 파일 및 폴더를 압축하여 server.zip으로 저장 | |
- name: zip distributions | |
run: sudo zip -r server.zip . | |
# AWS 인증 정보 설정 | |
- name: AWS configure 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: ap-northeast-2 | |
# S3로 압축 파일 업로드 | |
- name: upload to S3 | |
run: aws s3 cp --region ap-northeast-2 server.zip s3://${{secrets.BUCKET_NAME}}/public/ | |
# AWS CodeDeploy를 사용하여 배포 | |
- name: deploy with AWS codeDeploy | |
run: aws deploy create-deployment | |
--application-name ${{secrets.CODEDEPLOY_APP_NAME}} | |
--deployment-config-name CodeDeployDefault.OneAtATime | |
--deployment-group-name ${{secrets.CODEDEPLOY_DG_NAME}} | |
--s3-location bucket=${{secrets.BUCKET_NAME}},bundleType=zip,key=public/server.zip | |