From b40b4a267b8eba30c78611c2025043bfbc7a48b6 Mon Sep 17 00:00:00 2001 From: Leonhardt Koepsell Date: Sat, 2 Nov 2024 14:27:52 -0500 Subject: [PATCH] Refactor workflows Authored-by: Leonhardt Koepsell --- .github/workflows/pr.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/publish.yml | 29 ++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..14341d2 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,29 @@ +name: Pull Request + +on: + pull_request: + branches: + - main + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: gradle + + - name: Setup Docker + uses: docker/setup-buildx-action@v3 + + - name: Run Bootstrap + run: ./bootstrap.sh + + - name: Run Gradle Check + run: ./gradlew check diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d72db06..77219f0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,8 +6,31 @@ on: - 'v*' jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: gradle + + - name: Setup Docker + uses: docker/setup-buildx-action@v3 + + - name: Run Bootstrap + run: ./bootstrap.sh + + - name: Run Gradle Check + run: ./gradlew check + publish: if: github.repository == 'codebandits/gradle-container-plugin' + needs: check runs-on: ubuntu-latest permissions: contents: write @@ -23,9 +46,6 @@ jobs: java-version: 21 cache: gradle - - name: Install SOPS - uses: mdgreenwald/mozilla-sops-action@v1 - - name: Load Infrastructure Configuration uses: codebandits/github-actions/load-env@main id: configuration @@ -38,6 +58,9 @@ jobs: workload_identity_provider: ${{ steps.configuration.outputs.GCP_WORKLOAD_IDENTITY_PROVIDER }} service_account: ${{ steps.configuration.outputs.GCP_SERVICE_ACCOUNT }} + - name: Install SOPS + uses: mdgreenwald/mozilla-sops-action@v1 + - name: Set Version run: | TAG="${{ github.ref_name }}"