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 b40b4a2
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 26 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}"
Expand Down

0 comments on commit b40b4a2

Please sign in to comment.