diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7d01087..26d7bc3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,8 +2,6 @@ on: push: branches: develop - pull_request: - branches: develop # 작업 내용 jobs: diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml new file mode 100644 index 0000000..c9bd559 --- /dev/null +++ b/.github/workflows/pullRequest.yml @@ -0,0 +1,60 @@ +# 실행 시기 +on: + pull_request: + branches: develop + +# 작업 내용 +jobs: + build: + runs-on: ubuntu-latest + + services: + redis: + image: redis:latest + ports: + - 6379:6379 + steps: + - name: Chekcout Main Branch + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + + - name: Set application.yml + uses: microsoft/variable-substitution@v1 + with: + files: src/main/resources/application.yml + env: + spring.datasource.url: ${{ secrets.RDS_ENDPOINT }} + spring.datasource.username: ${{ secrets.RDS_USERNAME }} + spring.datasource.password: ${{ secrets.RDS_PASSWORD }} + spring.data.redis.host: ${{ secrets.REDIS_ENDPOINT }} + logging.slack.webhook-uri: ${{ secrets.SLACK_URL }} + jwt.secretkey: ${{ secrets.SECRETKEY }} + cloud.aws.credentials.access-key: ${{ secrets.AWS_ACCESS_KEY_ID }} + cloud.aws.credentials.secret-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + imp.api-secret-key: ${{ secrets.API_SECRET_KEY }} + imp.api-key: ${{ secrets.API_KEY }} + + + ## gradle caching/빌드 시간 단축 + - name: Gradle Caching + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant Permission Gradlew + run: chmod +x gradlew + shell: bash + + - name: Build Gradle + run: ./gradlew build + shell: bash