From dc2e4cf7aa60a27c3f363a1a89f518184c694844 Mon Sep 17 00:00:00 2001 From: Michael7371 <40476797+Michael7371@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:26:51 -0700 Subject: [PATCH] adding caching to github actions --- .github/workflows/artifact-publish.yml | 1 + .github/workflows/ci.yml | 1 + .github/workflows/docker.yml | 2 ++ .github/workflows/dockerhub.yml | 8 ++++++++ 4 files changed, 12 insertions(+) diff --git a/.github/workflows/artifact-publish.yml b/.github/workflows/artifact-publish.yml index e9900af7..8565ff85 100644 --- a/.github/workflows/artifact-publish.yml +++ b/.github/workflows/artifact-publish.yml @@ -19,6 +19,7 @@ jobs: with: java-version: '21' distribution: 'temurin' + cache: 'maven' - name: Remove snapshot from version run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb5a4c1a..746cda95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: with: java-version: '21' distribution: 'temurin' + cache: 'maven' # Step 3: Build and run SonarQube analysis without executing tests # This step involves navigating through project directories and using Maven for building each submodule project before conflict-visualizer repo diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f32d609a..dd052d0b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,3 +58,5 @@ jobs: MAVEN_GITHUB_ORG=${{ github.repository_owner }} secrets: | MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 5288bd4c..eee5ab62 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -62,3 +62,11 @@ jobs: file: ./${{ matrix.component }}/Dockerfile # Specify the Dockerfile path to build push: true # Enable pushing the built image to DockerHub this only for Dockerhub.yml tags: usdotjpoode/jpo-conflictvisualizer-${{ matrix.component }}:${{ env.DOCKER_TAG }} + build-args: | + MAVEN_GITHUB_TOKEN_NAME=${{ vars.MAVEN_GITHUB_TOKEN_NAME }} + MAVEN_GITHUB_TOKEN=${{ secrets.MAVEN_GITHUB_TOKEN }} + MAVEN_GITHUB_ORG=${{ github.repository_owner }} + secrets: | + MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file