buildah-build/.github/workflows/verify-build.yml
divyansh42 2b7e117c22 Add feature to pass extra args when building image
If a user wants to pass few extra args to build
command when building image, then he can pass
using 'extra-args' input parameter.

Signed-off-by: divyansh42 <diagrawa@redhat.com>
2021-01-28 19:53:57 +05:30

57 lines
1.6 KiB
YAML

# This workflow will perform a test whenever there
# is some change in code done to ensure that the changes
# are not buggy and we are getting the desired output.
name: Test Build
on: [push, pull_request, workflow_dispatch]
env:
TEST_REPO: spring-petclinic
IMAGE_NAME: spring-petclinic
jobs:
build:
name: Build image using Buildah
runs-on: ubuntu-latest
steps:
# Checkout buildah action github repository
- name: Checkout Buildah action
uses: actions/checkout@v2
with:
path: "buildah-build"
# Checkout spring-petclinic github repository
- name: Checkout spring-petclinic project
uses: actions/checkout@v2
with:
repository: "spring-projects/spring-petclinic"
path: ${{ env.TEST_REPO }}
# Setup java.
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
# Run maven to build the project
- name: Maven
working-directory: ${{ env.TEST_REPO }}
run: |
mvn package -ntp -B
# Build image using Buildah action
- name: Build Image
uses: ./buildah-build/
with:
image: ${{ env.IMAGE_NAME }}
# To avoid hardcoding a particular version of the binary.
content: |
./spring-petclinic/target/spring-petclinic-*.jar
entrypoint: |
java
-jar
spring-petclinic-*.jar
port: 8080
# Check if image is build
- name: Check images created
run: buildah images | grep '${{ env.IMAGE_NAME }}'