Merge pull request #157 from KUDDY-2023/feature/144-recommendserver-call #117
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: kuddy-server | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "develop" ] | |
env: # νμ¬ μ€ν¬λ¦½νΈμμ μ¬μ©ν νκ²½λ³μ μ μ | |
S3_BUCKET_NAME: onezerobucket | |
PROJECT_NAME: kuddy-server | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout # κΉνμ΄ μ 곡νλ μν¬μ€νμ΄μ€ (μ΄ workflow λ₯Ό μ€ννλ 곡κ°) μμ λ΄ μ μ₯μκ° μμΉν κ³³μΌλ‘ μ΄λ | |
uses: actions/checkout@v3 | |
- name: Set up JDK 11 # java μ μ | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
- name: Grant execute permission for gradlew # gradlewμ μ€νκΆν | |
run: chmod +x ./gradlew | |
shell: bash | |
- name: Decode application.yml for api-server | |
run: echo "${{ secrets.API_APPLICATION }}" | base64 -d > ./api-server/src/main/resources/application.yml | |
- name: Decode application.yml for chat-server | |
run: echo "${{ secrets.CHAT_APPLICATION }}" | base64 -d > ./chat-server/src/main/resources/application.yml | |
- name: Decode application.yml for noti-server | |
run: echo "${{ secrets.NOTI_APPLICATION }}" | base64 -d > ./noti-server/src/main/resources/application.yml | |
- name: Build with Gradle # νλ‘μ νΈ build | |
run: ./gradlew clean build -x test | |
shell: bash | |
- name: Make zip file | |
run: zip -r ./$GITHUB_SHA.zip . | |
shell: bash | |
- name: Configure AWS 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: ${{ secrets.AWS_REGION }} | |
- name: Upload to S3 | |
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://$S3_BUCKET_NAME/$PROJECT_NAME/$GITHUB_SHA.zip | |
- name: Code Deploy | |
run: aws deploy create-deployment --application-name $PROJECT_NAME --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name $PROJECT_NAME --s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=$PROJECT_NAME/$GITHUB_SHA.zip |