Java CI with Maven - Patched #37
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
| # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
| # 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. | |
| name: Java CI with Maven - Patched | |
| on: | |
| workflow_dispatch: | |
| env: | |
| SYSDIG_URL: https://app.au1.sysdig.com | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }}-patched | |
| BYPASS_SCAN_FAIL: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build the Docker image | |
| run: docker build . --file Dockerfile-patched --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }} --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| # - name: Sysdig Secure Inline Scan - Legacy | |
| # uses: sysdiglabs/[email protected] | |
| # with: | |
| # image-tag: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }} | |
| # sysdig-secure-token: ${{ secrets.SECURE_API_TOKEN }} | |
| # input-type: docker-daemon | |
| # sysdig-secure-url: https://app.au1.sysdig.com | |
| # run-as-user: root | |
| - name: Sysdig Secure Inline Scan - New | |
| run: | | |
| curl -LO "https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/$(curl -L -s https://download.sysdig.com/scanning/sysdig-cli-scanner/latest_version.txt)/linux/amd64/sysdig-cli-scanner" | |
| chmod +x ./sysdig-cli-scanner | |
| SECURE_API_TOKEN=${{ secrets.SECURE_API_TOKEN }} ./sysdig-cli-scanner --apiurl ${{env.SYSDIG_URL}} docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.run_number }} || ${{ env.BYPASS_SCAN_FAIL }} | |
| - name: Log in to the Container registry | |
| run: docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }} | |
| - name: Push the Docker image | |
| run: | | |
| docker push -a ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |