Skip to content

Commit

Permalink
Merge pull request #104 from Hanaro-trip-together-bank/workflow
Browse files Browse the repository at this point in the history
fix: pull_request 반영 조건 변경
  • Loading branch information
mummhy0811 authored Jun 3, 2024
2 parents d996fbc + 6546211 commit 608e457
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@ name: Java CI with Gradle

on:
push:
branches: [ "dev" ]
branches:
- dev
pull_request:
branches: [ "dev" ]
branches:
- dev
types:
- closed

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand All @@ -34,23 +38,7 @@ jobs:
mysql user: 'root'
mysql password: ${{ secrets.MYSQL_PASSWORD }}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# 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: make application.properties
- name: Make application.properties
run: |
mkdir -p ./src/main/resources
cd ./src/main/resources
Expand All @@ -64,7 +52,7 @@ jobs:
- name: Build with Gradle Wrapper
run: ./gradlew build

- name: dev Docker build & push to prod
- name: Dev Docker build & push to prod
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'dev' && github.event.pull_request.merged == true) }}
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
Expand Down

0 comments on commit 608e457

Please sign in to comment.