Skip to content

Commit

Permalink
refactor: pullrequest와 push일 때 githubAction 행위 나누기 (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunwon12 authored Feb 27, 2024
1 parent 4b75698 commit 2cfb1b9
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
on:
push:
branches: develop
pull_request:
branches: develop

# 작업 내용
jobs:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/pullRequest.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2cfb1b9

Please sign in to comment.