build-trivy-bundle #25
Workflow file for this run
This file contains hidden or 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-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: | |
| - self-hosted-nutanix-docker-large | |
| 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: Install xz utils | |
| id: install-xz-utils | |
| run: | | |
| sudo apt-get install xz-utils | |
| - name: Install NIX | |
| uses: cachix/install-nix-action@v31 | |
| - name: Install devbox | |
| uses: jetify-com/devbox-install-action@v0.14.0 | |
| with: | |
| enable-cache: true | |
| skip-nix-installation: "true" | |
| - 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) | |
| devbox run -- make publish-trivy-bundled-image -e TRIVY_VERSION=${{ inputs.trivyVersion }} -e TIMESTAMP=$IMAGE_TIMESTAMP -e ROOT_DIR=${{ github.WORKSPACE }} | |
| echo "IMAGE_TIMESTAMP=$IMAGE_TIMESTAMP" >> $GITHUB_OUTPUT |