Introduction of GitHub actions and GitLab Pages workflow #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: "Build and Verify" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
cache: maven | |
- name: Build with Maven | |
run: mvn --batch-mode -V -U verify -Dsurefire.useFile=false | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() | |
with: | |
report_paths: "**/target/surefire-reports/**/*.xml" | |
- name: Archive Service | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-service | |
path: | | |
service/target/quarkus-app | |
- name: Archive CLI | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-cli | |
path: | | |
cli/target/quarkus-app | |
image-service: | |
runs-on: ubuntu-latest | |
name: "Image / Service" | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download a single artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-service | |
path: service/target/quarkus-app | |
- name: Build Image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: sbomer-service | |
tags: latest ${{ github.sha }} | |
containerfiles: | | |
./images/sbomer-service/Containerfile | |
- name: Push to Quay | |
id: push-to-quay | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: ${{ secrets.REGISTRY_ORG_STAGE }} | |
username: ${{ secrets.REGISTRY_USER_STAGE }} | |
password: ${{ secrets.REGISTRY_PASSWORD_STAGE }} |