Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github actions file #42

Open
wants to merge 2 commits into
base: 1.1.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/service-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: build on maven

on:
watch:
types: [started]
pull_request:
types: [opened, reopened, edited, synchronize, ready_for_review]
push:
branches:
- main
- master
- 1.1.x
- '**'

workflow_dispatch:

jobs:
verify:
name: verify with maven
runs-on: ubuntu-latest
env:
MAVEN_OPTS: "-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m"
steps:
- uses: actions/checkout@v4

- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
distribution: 'temurin'
architecture: x64
java-version: |
11

- uses: s4u/[email protected]
with:
sonatypeSnapshots: true

- name: Build the serivce verify phase
run: mvn -B -V clean verify -Prun-its

build:
name: Build and push
runs-on: ubuntu-latest
needs: verify
if: ${{ github.event_name == 'push' }}
env:
MAVEN_OPTS: "-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m"
steps:
- uses: actions/checkout@v4

- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
distribution: 'temurin'
architecture: x64
java-version: |
11

- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: shokakucarrier/commonjava-images
shokakucarrier marked this conversation as resolved.
Show resolved Hide resolved
path: commonjava-images

- name: Log in to Quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
registry: quay.io

- name: Buildah build
id: buildah-build
uses: redhat-actions/buildah-build@v2
with:
image: indy
shokakucarrier marked this conversation as resolved.
Show resolved Hide resolved
tags: latest-${{ github.ref_name }}
shokakucarrier marked this conversation as resolved.
Show resolved Hide resolved
platforms: linux/amd64
containerfiles: |
commonjava-images/indy-archive-service/multistage.Dockerfile
context: commonjava-images/indy-archive-service/
build-args: |
GIT_URL=https://github.com/${{ github.repository }}
GIT_REVISION=${{ github.ref }}

- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.buildah-build.outputs.image }}
tags: ${{ steps.buildah-build.outputs.tags }}
registry: quay.io/factory2
Loading