Skip to content

Merge branch 'develop' of https://github.com/MAKAR-iOS/MAKAR-BE into … #32

Merge branch 'develop' of https://github.com/MAKAR-iOS/MAKAR-BE into …

Merge branch 'develop' of https://github.com/MAKAR-iOS/MAKAR-BE into … #32

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ "develop" ]
# pull_request:
# branches: [ "develop" ]
env:
RESOURCE_PATH: src/main/resources/application.yaml
jobs:
build-with-gradle:
runs-on: ubuntu-22.04
steps:
- name: develop 브랜치로 이동
uses: actions/checkout@v4
with:
ref: develop
- name: JDK 17 설치
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
- name: yml 파일 세팅
uses: microsoft/variable-substitution@v1
with:
files: ${{ env.RESOURCE_PATH }}
env:
app.jwt.accessTokenValidMS: ${{ secrets.ACCESS_TOKEN_EXP }}
app.jwt.refreshTokenValidMS: ${{ secrets.REFRESH_TOKEN_EXP }}
odsay.api-key: ${{ secrets.ODSAY_API_KEY }}
spring.datasource.url: ${{ secrets.DATASOURCE_URL }}
spring.datasource.username: ${{ secrets.DATASOURCE_USERNAME }}
spring.datasource.password: ${{ secrets.DATASOURCE_PASSWORD }}
- name: gradlew에 실행 권한 부여
run: chmod +x ./gradlew
- name: 프로젝트 빌드
run: ./gradlew build
- name: AWS credential 설정
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
# - name: zip 파일 생성
# run: zip -r project.zip .
- name: S3에 업로드
run: aws deploy push --application-name ${{ secrets.AWS_CODE_DEPLOY_APPLICATION }} --ignore-hidden-files --s3-location s3://${{ secrets.AWS_S3_BUCKET }}/makar/$GITHUB_SHA.zip --source .
- name: EC2에 업로드
run: aws deploy create-deployment --application-name ${{ secrets.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ secrets.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=${{ secrets.AWS_S3_BUCKET }},key=makar/$GITHUB_SHA.zip,bundleType=zip