fix: 가족 생성 로직과 유저의 채팅방 입장 로직 분리 #61
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: familing CI/CD | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
env: | |
S3_BUCKET_NAME: familing-bucket | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
# 사용하는 자바 버전 17 | |
java-version: '17' | |
distribution: 'temurin' | |
- run: touch ./familing/src/main/resources/application.yml | |
- run: echo "${{ secrets.APPLICATION }}" > ./familing/src/main/resources/application.yml | |
- run: cat ./familing/src/main/resources/application.yml | |
# gradlew에 권한 부여 | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./familing/gradlew | |
# gradlew 빌드 | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 | |
with: | |
arguments: build | |
build-root-directory: ./familing | |
# 압축파일 형태로 전달 | |
- name: Make zip file | |
run: zip -r ./familing.zip . | |
shell: bash | |
# S3 Bucket으로 Copy | |
- name: Deliver to AWS S3 | |
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: ${{ secrets.AWS_REGION }} | |
- name: Upload to S3 | |
run: aws s3 cp --region ap-northeast-2 ./familing.zip s3://$S3_BUCKET_NAME/familing.zip | |
# Deploy | |
# applicatio-name => aws code deploy application 이름 | |
- name: Deploy | |
run: | | |
aws deploy create-deployment \ | |
--application-name familing \ | |
--deployment-config-name CodeDeployDefault.AllAtOnce \ | |
--deployment-group-name familing-deploy-group \ | |
--file-exists-behavior OVERWRITE \ | |
--s3-location bucket=familing-bucket,bundleType=zip,key=familing.zip \ | |
--region ap-northeast-2 |