Update Gradle to v9.6.1 #643
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Image CI | |
| on: | |
| push: | |
| branches: [ 'master' ] | |
| pull_request: | |
| branches: [ 'master' ] | |
| env: | |
| DOCKER_USER: a002k | |
| DOCKER_IMAGE: micronaut | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 26 | |
| cache: 'gradle' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@11d4d83c63a6ce61b32d8a9c4faddbdb04fe9917 | |
| with: | |
| gradle-version: '9.6.1' | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar-${{ hashFiles('**/build.gradle') }} | |
| restore-keys: ${{ runner.os }}-sonar- | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: ${{ runner.os }}-gradle- | |
| - name: Build and analyze | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: gradle build dockerfile jacocoTestReport sonar --info | |
| - name: Compute version | |
| run: | | |
| gradle printVersion | |
| echo "BUILD_VERSION=$(gradle printVersion -q)" >> $GITHUB_ENV | |
| - name: Login to Docker Hub | |
| env: | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | |
| - name: Build and tag the Docker image | |
| working-directory: ./mnt/build/docker/main | |
| run: docker build -t $DOCKER_USER/$DOCKER_IMAGE:${{ env.BUILD_VERSION }} -t $DOCKER_USER/$DOCKER_IMAGE:latest . | |
| - name: Push the Docker image | |
| run: docker push $DOCKER_USER/$DOCKER_IMAGE --all-tags |