diff --git a/.github/workflows/build-image-to-dockerhub.yml b/.github/workflows/build-image-to-dockerhub.yml index 90db4150..55cfe385 100644 --- a/.github/workflows/build-image-to-dockerhub.yml +++ b/.github/workflows/build-image-to-dockerhub.yml @@ -1,43 +1,34 @@ -name: Pull Request Gradle Build Test +name: Java CI with Gradle on: - pull_request: - types: [ opened, synchronize, closed ] + push: + branches: [ "feature/#4-set-deploy-pipeline" ] -permissions: read-all +permissions: + contents: read jobs: - build-test: + build: runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write steps: - - name: Git Checkout - uses: actions/checkout@v3.0.2 - - uses: dorny/paths-filter@v2 - id: changes - with: - filters: | - application: - - 'build.gradle.kts' - - '**/src/**' + - name: checkout + uses: actions/checkout@v3 - - name: JDK 설치 - if: steps.changes.outputs.application == 'true' + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: zulu - java-version: 17 - cache: 'gradle' + java-version: '17' + distribution: 'temurin' + + ## gradle build + - name: Build with Gradle + run: ./gradlew bootJar - - name: gradlew 권한 부여 - run: chmod +x ./gradlew - - name: Gradle Build - if: steps.changes.outputs.application == 'true' - env: - JASYPT_ENCRYPTION_PASSWORD: ${{ secrets.PROPERTY_ENCRYPTION_PASSWORD }} + ## 웹 이미지 빌드 및 도커허브에 push + - name: web docker build and push run: | - ./gradlew build --no-build-cache + docker login -u egg528 -p tkfkd0104! + docker build --no-cache -t egg528/test . + docker push egg528/test \ No newline at end of file