diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 840f24d..9cc0238 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -14,7 +14,9 @@ jobs: 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: @@ -35,7 +37,6 @@ jobs: - name: Build with Gradle Wrapper run: ./gradlew build - env: ACTIVE_PROFILE: ${{ secrets.ACTIVE_PROFILE }} @@ -61,11 +62,32 @@ jobs: USER_DAFAULTIMAGE: ${{ secrets.USER_DAFAULTIMAGE }} + docker-build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Grant execute permisson for gradlew + run: chmod +x gradlew + + - name: Build with Gradle (without Test) + run: ./gradlew clean build -x test --stacktrace + - name: Docker build run: | docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker build -t app . - sudo docker build --build-arg ACTIVE_PROFILE=${{ secrets.ACTIVE_PROFILE }} \ + docker build --build-arg ACTIVE_PROFILE=${{ secrets.ACTIVE_PROFILE }} \ --build-arg DATASOURCE_URL_DEV=${{ secrets.DATASOURCE_URL_DEV }} \ --build-arg DATASOURCE_USERNAME=${{ secrets.DATASOURCE_USERNAME }} \ --build-arg DATASOURCE_PASSWORD=${{ secrets.DATASOURCE_PASSWORD }} \