Skip to content

Commit

Permalink
ci: refactor ci with modularization
Browse files Browse the repository at this point in the history
  • Loading branch information
davdarras committed Nov 15, 2024
1 parent dd57167 commit f7c9a3b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Build with Maven
run: mvn -B clean package
run: mvn -B clean package --no-transfer-progress
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.20.0
with:
Expand All @@ -26,10 +26,10 @@ jobs:
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: Upload jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jar
path: target/*.jar
name: app-jar
path: platine-management-api/target/*.jar

get_version:
needs: build
Expand All @@ -40,7 +40,7 @@ jobs:
version: ${{steps.version.outputs.version}}
steps:
- name: Checkout current branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Get current version
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: softprops/action-gh-release@v1
Expand All @@ -72,15 +72,15 @@ jobs:
needs: get_version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Download jar
id: download
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: jar
path: target
name: app-jar
path: platine-management-api/target
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Build with Maven
run: mvn -B clean package
run: mvn -B clean package --no-transfer-progress
- name: Upload jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jar
path: target/*.jar
name: app-jar
path: platine-management-api/target/*.jar

get_version:
needs: build
Expand All @@ -32,7 +32,7 @@ jobs:
version: ${{steps.version.outputs.version}}
steps:
- name: Checkout current branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Get current version
Expand All @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: softprops/action-gh-release@v1
Expand All @@ -62,15 +62,15 @@ jobs:
needs: get_version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Download jar
id: download
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: jar
path: target
name: app-jar
path: platine-management-api/target
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
Expand Down

0 comments on commit f7c9a3b

Please sign in to comment.