Skip to content

Commit

Permalink
Merge pull request #16 from mesosphere/asekretenko/new_image_workflow
Browse files Browse the repository at this point in the history
feat: add a workflow for building an image for a new tag
  • Loading branch information
kaiwalyajoshi authored Mar 1, 2024
2 parents 2b6fe47 + 3300122 commit 5b5a807
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-on-demand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build-trivy-bundle

on:
workflow_dispatch:
inputs:
trivyVersion:
description: 'Tag of the Trivy image to use as a base'
type: string
required: true

jobs:
build-trivy-bundle:
runs-on: ubuntu-latest
outputs:
IMAGE_TIMESTAMP: ${{ steps.build-and-push-image.outputs.IMAGE_TIMESTAMP }}
steps:
- name: Clone trivy-bundles Repository
uses: actions/checkout@v3
with:
repository: mesosphere/trivy-bundles
ref: main

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_READ_WRITE_USERNAME }}
password: ${{ secrets.DOCKER_READ_WRITE_PASSWORD }}

- name: Build and push a trivy-bundles image
id: build-and-push-image
run: |
IMAGE_TIMESTAMP=$(date -u +%Y%m%dT%H%M%SZ)
TRIVY_VERSION=${{ inputs.trivyVersion }} TIMESTAMP=$IMAGE_TIMESTAMP make publish-trivy-bundled-image
echo "IMAGE_TIMESTAMP=$IMAGE_TIMESTAMP" >> $GITHUB_OUTPUT

0 comments on commit 5b5a807

Please sign in to comment.