diff --git a/.github/workflows/docker-image-rest.yml b/.github/workflows/docker-image-rest.yml index 1931056..ed68c7c 100644 --- a/.github/workflows/docker-image-rest.yml +++ b/.github/workflows/docker-image-rest.yml @@ -1,4 +1,3 @@ - name: Docker Image on: @@ -7,27 +6,47 @@ on: jobs: docker: - runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 + with: + images: ipbhalle/metfragweb + + - name: Maven Build Cache for Docker + uses: actions/cache@v4 + with: + path: maven-cache + key: ${{ runner.os }}-maven-cache-${{ hashFiles('**/pom.xml') }} + + - name: Inject Maven Build Cache into Docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.0 with: - images: ipbhalle/metfragrest + cache-map: | + { + "maven-cache": "/root/.m2" + } - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: push: true file: Dockerfile-REST tags: ipbhalle/metfragrest:latest - cache-from: type=registry,ref=ipbhalle/metfragrest:latest - cache-to: type=inline + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index cade5a2..0830c75 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,20 +13,19 @@ jobs: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v4 - - - name: Set up Docker Buildx + + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker Hub + + - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker + + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: @@ -38,14 +37,14 @@ jobs: type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }} # set dev tag for dev branch type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev'}} - - - name: Maven Build Cache for Docker + + - name: Maven Build Cache for Docker uses: actions/cache@v4 with: path: maven-cache key: ${{ runner.os }}-maven-cache-${{ hashFiles('**/pom.xml') }} - - - name: Inject Maven Build Cache into Docker + + - name: Inject Maven Build Cache into Docker uses: reproducible-containers/buildkit-cache-dance@v3.1.0 with: cache-map: | @@ -60,6 +59,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha - cache-to: type=gha,mode=max -# cache-from: type=registry,ref=ipbhalle/metfragweb:buildcache -# cache-to: type=registry,ref=ipbhalle/metfragweb:buildcache,mode=max \ No newline at end of file + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8b051af..a680dee 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,6 +1,3 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - name: Build with Maven on: @@ -13,15 +10,13 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - run: mvn -Dhttps.protocols=TLSv1.2 -B package --file pom.xml - + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - run: mvn package \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47e20e1..963c9e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,21 +7,16 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - run: mvn -Dhttps.protocols=TLSv1.2 package -pl MetFragCommandLine -am -DskipTests - - name: Add asset to release - uses: softprops/action-gh-release@v1 - with: - files: 'MetFragCommandLine/target/MetFragCommandLine-*jar' - - - + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - run: mvn package -pl MetFragCommandLine -am -DskipTests + - name: Add asset to release + uses: softprops/action-gh-release@v2 + with: + files: 'MetFragCommandLine/target/MetFragCommandLine-*jar' \ No newline at end of file