[fix] 데이터베이스 변경 #72
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 | |
on: | |
push: | |
branches: | |
- backend | |
env: | |
AWS_REGION: ap-northeast-2 | |
AWS_S3_ACCESS_KEY: ${{secrets.AWS_S3_ACCESS_KEY}} | |
AWS_S3_SECRET_KEY: ${{secrets.AWS_S3_SECRET_KEY}} | |
AWS_S3_BUCKET: ${{secrets.AWS_S3_BUCKET}} | |
JWT_SECRET: ${{secrets.JWT_SECRET}} | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v2 | |
- name: JDK 17 setup | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: gradlew chmod | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
- name: AWS credential setting | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: upload to s3 | |
run: aws deploy push --application-name dodo-codedeploy --ignore-hidden-files --s3-location s3://my-dodo-bucket/build.zip --source . | |
- name: EC2 deploy | |
run: aws deploy create-deployment | |
--application-name dodo-codedeploy | |
--deployment-config-name CodeDeployDefault.AllAtOnce | |
--deployment-group-name dodo-group | |
--s3-location bucket=my-dodo-bucket,bundleType=zip,key=build.zip |