Fix actions/setup-maven repository not found #8
Workflow file for this run
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: Java CI with Maven | |
on: | |
push: | |
branches: ["another-feature"] | |
pull_request: | |
branches: ["another-feature"] | |
permissions: | |
contents: read | |
checks: write | |
id-token: write | |
jobs: | |
test: | |
name: Build and Run Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Check out code | |
- name: Setup Maven Action | |
uses: s4u/setup-maven-action@v1.11.0 | |
with: | |
java-version: 17 | |
- name: Run tests | |
run: mvn test | |
- name: Generate report | |
uses: mikepenz/action-junit-report@v4 | |
with: | |
report-path: target/surefire-reports | |
generate-html-report: true | |
build-and-push-docker-image: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build image | |
run: mvn spring-boot:build-image -Ddockerfile=Dockerfile.layers -DskipTests | |
- name: Get image name | |
id: get-image-name | |
run: echo "${{ steps.build.outputs.IMAGE_NAME }}" | |
- name: Push image | |
run: docker push ${{ steps.get-image-name.outputs.IMAGE_NAME }} |