fix file name for trivvy #14
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: webmethods-microservicesruntime-wpm-demo | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| # ${{ github.repository }} = <account>/<repo> | |
| # ${{ github.workflow }} = name of the workflow | |
| BUILD_IMAGE_NAME: ${{ github.repository }} | |
| WEBMETHODS_BASE_REGISTRY: ibmwebmethods.azurecr.io | |
| WEBMETHODS_BASE_REPOSITORY: webmethods-microservicesruntime | |
| WEBMETHODS_BASE_TAG: "11.1.0.5" | |
| ## WPM tool download is at: https://www.ibm.com/resources/mrs/assets/mrs_landing_page?source=wpm&lang=en_US | |
| WPM_PACKAGES: WmJDBCAdapter:v10.3.8.21 WmMQAdapter:v6.5.5.52 WmCloudStreams:v11.1.0 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Required for creating releases and uploading assets | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Install tools on the builder instance | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y unzip curl | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| # Set up BuildKit Docker container builder to be able to build | |
| # multi-platform images and export cache | |
| # https://github.com/docker/setup-buildx-action | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to webMethods container registry | |
| uses: docker/[email protected] | |
| with: | |
| registry: ${{ env.WEBMETHODS_BASE_REGISTRY }} | |
| username: ${{ secrets.webmethods_cr_username }} | |
| password: ${{ secrets.webmethods_cr_password }} | |
| # Login against a github registry except on PR | |
| # https://github.com/docker/login-action | |
| - name: Log into registry ghcr.io | |
| if: github.event_name != 'pull_request' | |
| uses: docker/[email protected] | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ env.BUILD_IMAGE_NAME }} | |
| tags: | | |
| type=sha | |
| type=match,pattern=v(.*),group=1 | |
| - name: Download file | |
| run: | | |
| curl -o wpm.zip ${{ secrets.WPM_DOWNLOAD_URI }} && unzip wpm.zip | |
| # Build image for scanning | |
| # https://github.com/docker/build-push-action | |
| - name: Build image locally for scanning | |
| id: build-before-sec-scans | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/amd64 | |
| build-args: | | |
| BASE_IMAGE=${{ env.WEBMETHODS_BASE_REGISTRY }}/${{ env.WEBMETHODS_BASE_REPOSITORY }}:${{ env.WEBMETHODS_BASE_TAG }} | |
| WPM_TOKEN=${{ secrets.WPM_TOKEN }} | |
| WPM_PACKAGES=${{ env.WPM_PACKAGES }} | |
| load: true | |
| tags: ${{env.BUILD_IMAGE_NAME}}:${{ github.sha }} | |
| - name: Run Trivy vulnerability scanner HTML | |
| continue-on-error: false | |
| uses: aquasecurity/[email protected] | |
| with: | |
| scan-type: image | |
| image-ref: ${{env.BUILD_IMAGE_NAME}}:${{ github.sha }} | |
| # For now, always succeed when vulns are detected. | |
| # Later, we can flip this to '1' to fail builds. | |
| exit-code: '0' | |
| ignore-unfixed: true | |
| vuln-type: 'os,library' | |
| severity: 'CRITICAL,HIGH' | |
| format: json | |
| output: trivy-${{ github.workflow }}.json | |
| - name: Build and push Docker image | |
| id: build-and-push-after-sec-scans | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/amd64 | |
| build-args: | | |
| BASE_IMAGE=${{ env.WEBMETHODS_BASE_REGISTRY }}/${{ env.WEBMETHODS_BASE_REPOSITORY }}:${{ env.WEBMETHODS_BASE_TAG }} | |
| WPM_TOKEN=${{ secrets.WPM_TOKEN }} | |
| WPM_PACKAGES=${{ env.WPM_PACKAGES }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Simple digest descriptor | |
| run: echo "Container Digest=${{ steps.build-and-push-after-sec-scans.outputs.digest }}" > digest-${{ github.workflow }}.txt | |
| - name: Create Release | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| digest-${{ github.workflow }}.txt | |
| trivy-${{ github.workflow }}.json | |