🔧 rearrange metrics and tweak some views #29
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/CD Pipeline | |
on: | |
push: | |
branches: ['main'] | |
jobs: | |
build_test_java: | |
name: Build Java services | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive | |
- name: Update dependency graph | |
continue-on-error: true | |
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 | |
build_publish_docker: | |
name: Build&Publish - Util Docker images | |
runs-on: ubuntu-latest | |
needs: build_test_java | |
strategy: | |
matrix: | |
image: | |
- prometheus | |
- grafana | |
- snmp-exporter | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
file: ./docker/${{ matrix.image }}/Dockerfile | |
push: true | |
tags: ghcr.io/tobias-pe/microservices_energyefficiency/${{ matrix.image }}:latest, ghcr.io/tobias-pe/microservices_energyefficiency/${{ matrix.image }}:${{ github.run_id }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
build_publish_spring_boot: | |
name: Build&Publish - Spring Boot Docker images | |
runs-on: ubuntu-latest | |
needs: build_test_java | |
strategy: | |
matrix: | |
image: | |
- gateway | |
- servicediscovery | |
- userservice | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: Make Maven Wrapper executable | |
if: contains(matrix.os, 'win') == false | |
run: chmod +x ./mvnw | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set VERSION environment variable | |
run: | | |
echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl ${{ matrix.image }})" >> $GITHUB_ENV | |
- name: Docker Build-Tag-Push | |
run: | | |
./mvnw spring-boot:build-image -pl ${{ matrix.image }} -am | |
docker tag ${{ matrix.image }}:${{ env.VERSION }} ghcr.io/tobias-pe/microservices_energyefficiency/${{ matrix.image }}:${{ github.run_id }} | |
docker tag ${{ matrix.image }}:${{ env.VERSION }} ghcr.io/tobias-pe/microservices_energyefficiency/${{ matrix.image }}:${{ env.VERSION }} | |
docker tag ${{ matrix.image }}:${{ env.VERSION }} ghcr.io/tobias-pe/microservices_energyefficiency/${{ matrix.image }}:latest | |
docker push ghcr.io/tobias-pe/microservices_energyefficiency/${{ matrix.image }}:latest |