Create DiscoveryServerApplication.run.xml #32
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: build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
buildservice: | |
name: build & test | |
runs-on: ubuntu-latest | |
steps: | |
- name: generate buildnumber | |
id: buildnumber | |
uses: einaregilsson/build-number@v3 | |
with: | |
token: ${{secrets.github_token}} | |
- name: checkout root | |
uses: actions/checkout@v2 | |
with: | |
repository: geekymon2/carmarketplace | |
path: root | |
- name: checkout service | |
uses: actions/checkout@v2 | |
with: | |
path: service | |
- name: read docker properties | |
uses: madhead/read-java-properties@latest | |
id: docker | |
with: | |
file: service/docker.properties | |
all: true | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
cache: maven | |
- name: build root | |
run: mvn install --file root/pom.xml -N | |
- name: build core | |
run: mvn install --file root/pom.xml | |
- name: build service | |
run: mvn -B test package jacoco:report --file service/pom.xml -Dspring.profiles.active=test | |
- name: Upload to codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: service/coverage/reports/ | |
verbose: true | |
- name: dockerhub login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: push docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./service | |
push: true | |
tags: | | |
geekymon2/${{ steps.docker.outputs.IMAGE_NAME }}:${{ steps.docker.outputs.MAJOR_VERSION }}.${{ steps.docker.outputs.MINOR_VERSION }}.${{ steps.buildnumber.outputs.build_number }} | |
geekymon2/${{ steps.docker.outputs.IMAGE_NAME }}:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
ARTIFACT_NAME=${{ steps.docker.outputs.ARTIFACT_NAME }} | |
- name: Docker Hub Description | |
uses: peter-evans/dockerhub-description@v2 | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKERHUB_REPOSITORY: geekymon2/${{ steps.docker.outputs.IMAGE_NAME }} | |
README_FILEPATH: service/README.md |