refactor: #116 - 유저 회원정보 수정 로직 변경 #9
Workflow file for this run
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 & CD for dodal-dev | |
on: | |
push: | |
branches: [ "refactor/#116" ] | |
env: | |
S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME_DEV }} | |
CODE_DEPLOY_APPLICATION_NAME: dodal-code-deploy | |
CODE_DEPLOY_DEPLOYMENT_GROUP: deploy | |
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' | |
- name: make application-dev.yml | |
run: | | |
cd ./src/main/resources | |
touch ./application-dev.yml | |
echo "${{ secrets.APPLICATION_DEV }}" > ./application-dev.yml | |
touch ./application.yml | |
echo "${{ secrets.APPLICATION_YML }}" > ./application.yml | |
cd ../../test/resources | |
touch ./application.yml | |
echo "${{ secrets.APPLICATION_YML }}" > ./application.yml | |
- name: create-json | |
id: create-json | |
uses: jsdaniell/[email protected] | |
with: | |
name: "dodal-fcm.json" | |
json: ${{ secrets.FCM_JSON }} | |
dir: src/main/resources | |
- name: Build with Gradle | |
run: | | |
./gradlew cleanQuerydslSourceDir | |
./gradlew build | |
# S3에 전송할 디렉토리 생성 | |
- name: Make Directory for deliver | |
run: mkdir -p ./dev/scripts | |
- name: Copy Jar | |
run: | | |
chmod +x ./build/libs/*.jar | |
cp ./build/libs/*.jar ./dev/ | |
cp ./deploy/appspec-dev.yml ./dev/appspec.yml | |
cp ./deploy/scripts/deploy-dev.sh ./dev/scripts/deploy-dev.sh | |
# 압축파일 형태로 전달 | |
- name: Make zip fileㅊ | |
run: | | |
cd ./dev | |
zip -r ./deploy-dev.zip . | |
# S3 Bucket으로 copy | |
- name: Deliver to AWS S3 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_DEV }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY_DEV }} | |
run: | | |
aws s3 cp \ | |
--region ap-northeast-2 \ | |
--acl private ./dev/deploy-dev.zip s3://${{ env.S3_BUCKET_NAME }}/deploy/deploy-dev.zip | |
# CodeDeploy | |
- name: Deploy | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CODE_DEPLOY_ACCESS_KEY_DEV }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CODE_DEPLOY_SECRET_KEY_DEV }} | |
run: | | |
aws deploy create-deployment \ | |
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} \ | |
--deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP }} \ | |
--file-exists-behavior OVERWRITE \ | |
--ignore-application-stop-failures \ | |
--s3-location bucket=${{ env.S3_BUCKET_NAME }},bundleType=zip,key=deploy/deploy-dev.zip \ | |
--region ap-northeast-2 |