create,update vaildation grouping #37
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: [ "master" ] | |
env: | |
AWS_REGION: us-east-2 | |
AWS_S3_BUCKET: github-action-code | |
AWS_CODE_DEPLOY_APPLICATION: githubaction | |
AWS_CODE_DEPLOY_GROUP: github-action | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: CI서버에 체크아웃 | |
uses: actions/checkout@v3 | |
- name: 자바 17 버전 세팅 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: application.yml 설정파일 세팅 | |
run: | | |
mkdir -p ./src/main/resources | |
touch ./src/main/resources/application.yml | |
echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml | |
- name: gradlew 권한 설정 | |
run: chmod +x gradlew | |
- name: 빌드 | |
run: ./gradlew build | |
- name: AWS credential 설정 | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESSKEY }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRETKEY }} | |
- name: S3에 업로드 | |
run: aws deploy push --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --ignore-hidden-files --s3-location s3://$AWS_S3_BUCKET/$GITHUB_SHA.zip --source . | |
- name: EC2에 배포 | |
run: aws deploy create-deployment --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=$AWS_S3_BUCKET,key=$GITHUB_SHA.zip,bundleType=zip |