Build Image

This workflow uses Kaniko to build and archive a Docker image. The image tag is created based on user inputs, Git tags, or commit information. The image is built, saved as a `.tar` file, and the digest is retrieved using crane. Finally, the image, tag, and digest are uploaded as artifacts. To use this component, you need to have a `Dockerfile` in your repository's root directory.

The build-image workflow accepts the following inputs:

NameDescriptionRequiredDefault Value
api-urlURL of the DevGuard APINohttps://api.main.devguard.org
asset-nameName of the asset to be scannedYes
pathPath to the source code to be scannedNo.
image-destination-pathDestination of the image.tar fileNoimage.tar
imageOCI image name, includes the tag nameNo
artifact-suffixThis is only needed if you are using this job multiple times in the same workflow. For example if you are scanning multiple images build from the same source with different configuration.No''
image-suffixSuffix for the image name. You probably need this if you are building multiple images. For example building a -scanner image and a -web image.No''
disable-artifact-registry-as-image-storeIf the artifact size is too big for your github usage quota, set this to true. This will push the image directly to the registry instead of uploading it as artifact.Nofalse

Usage Example: Here’s an example of how to call this reusable workflow from another workflow file:

name: DevGuard Workflow
 
on:
    push
 
jobs:
    devguard-build-image:
        uses: l3montree-dev/devguard-action/.github/workflows/build-image.yml@main
        with:
          api-url: https://api.main.devguard.org
          asset-name: 'myOrgnaization/projects/myProject/assets/myAsset'
        secrets:
          devguard-token: ${{ secrets.DEVGUARD_TOKEN }}