Skip to content

Commit

Permalink
Refactor workflows
Browse files Browse the repository at this point in the history
Authored-by: Leonhardt Koepsell <[email protected]>
  • Loading branch information
lnhrdt committed Nov 2, 2024
1 parent d0ddf0d commit ca042ab
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 23 deletions.
24 changes: 24 additions & 0 deletions .github/actions/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI Check

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
21 changes: 1 addition & 20 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,4 @@ on:

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
uses: ./.github/actions/check.yml
10 changes: 10 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Pull Request

on:
pull_request:
branches:
- main

jobs:
pr-check:
uses: ./.github/actions/check.yml
10 changes: 7 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ on:
- 'v*'

jobs:
check:
uses: ./.github/actions/check.yml

publish:
if: github.repository == 'codebandits/gradle-container-plugin'
needs: check
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -23,9 +27,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
Expand All @@ -38,6 +39,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 }}"
Expand Down

0 comments on commit ca042ab

Please sign in to comment.