Skip to content

Commit

Permalink
Merge pull request #19 from CSID-DGU/feat/#11-cicd
Browse files Browse the repository at this point in the history
[CHORE] Update CD.yml
  • Loading branch information
bbabbi authored Oct 14, 2024
2 parents dec5aef + 5032f86 commit cfc4a32
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# 워크플로우의 이름 지정
name: CD

on:
Expand Down Expand Up @@ -49,25 +48,39 @@ jobs:
shell: bash

- name: Grant execute permission for gradlew
run: chmod +x gradlew
run: |
cd server
chmod +x gradlew
- name: Build with Gradle # 실제 application build(-x 옵션을 통해 test는 제외)
run: ./gradlew build -x test
run: |
cd server
./gradlew build -x test
- name: Make Directory
run: mkdir -p deploy
run: |
cd server
mkdir -p deploy
- name: Copy Jar
run: cp ./build/libs/*.jar ./deploy
run: |
cd server
cp ./build/libs/*.jar ./deploy
- name: Copy appspec.yml
run: cp appspec.yml ./deploy
run: |
cd server
cp appspec.yml ./deploy
- name: Copy script
run: cp ./scripts/*.sh ./deploy
run: |
cd server
cp ./scripts/*.sh ./deploy
- name: Make zip file
run: zip -r ./cecd-1921.zip ./deploy
run: |
cd server
zip -r ./cecd-1921.zip ./deploy
shell: bash

- name: Configure AWS credentials
Expand All @@ -78,7 +91,13 @@ jobs:
aws-region: ap-northeast-2

- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./cecd-1921.zip s3://$S3_BUCKET_NAME/
run: |
cd server
aws s3 cp --region ap-northeast-2 ./cecd-1921.zip s3://$S3_BUCKET_NAME/
- name: Change to server directory # Deploy 전에 server 디렉토리로 이동
run: cd server
shell: bash

- name: Deploy
env:
Expand Down

0 comments on commit cfc4a32

Please sign in to comment.