Merge branch 'main' of https://github.com/joejoe2/spring-jwt-template #64
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: workflow | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- 'pom.xml' | |
- 'Dockerfile' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 # downloads a copy of repository | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Test | |
run: mvn test | |
- name: Build jar | |
run: mvn package -Dmaven.test.skip=true | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Build and Push to Docker Hub | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/spring-jwt-template:latest | |
- name: Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: ./target/site/jacoco/jacoco.xml # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) |