chore(deps): update actions/setup-java action to v4 (#259) #824
This file contains 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: CI Build | |
on: | |
push: | |
branches: | |
- "**" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
distribution: [ 'temurin' ] | |
java: [ '17' ] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: ${{ matrix.distribution }} | |
cache: 'gradle' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- if: ${{ github.ref == 'refs/heads/main' }} | |
name: SonarQube Scan | |
run: ./gradlew sonarqube | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- if: ${{ github.ref == 'refs/heads/main' }} | |
name: Build and Publish Docker Image | |
run: | | |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
./gradlew bootBuildImage --imageName=${{ secrets.DOCKER_USERNAME }}/mfscreener | |
docker push ${{ secrets.DOCKER_USERNAME }}/mfscreener |