Bump aquasecurity/trivy-action in /.github/workflows #5
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: BinanceBot Release Pipeline | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "master" ] | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-push-images: | |
| name: Build and push Docker images | |
| runs-on: ubuntu-latest | |
| environment: DefaultEnv | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| strategy: | |
| matrix: | |
| app: | |
| - name: marketbot | |
| dockerfile: Dockerfile.marketbot | |
| project: BinanceBot.MarketBot.Console | |
| - name: marketviewer | |
| dockerfile: Dockerfile.marketviewer | |
| project: BinanceBot.MarketViewer.Console | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} | |
| - name: Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ghcr.io/${{ github.repository_owner }}/binancebot-${{ matrix.app.name }} | |
| tags: | | |
| type=raw,value=latest | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha | |
| labels: | | |
| org.opencontainers.image.source=${{ github.repository }} | |
| org.opencontainers.image.created=${{ github.event.head_commit.timestamp }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.title=BinanceBot ${{ matrix.app.name }} | |
| org.opencontainers.image.description=BinanceBot ${{ matrix.app.project }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./${{ matrix.app.dockerfile }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=${{ matrix.app.name }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.app.name }} | |
| build-args: | | |
| PROJECT_NAME=${{ matrix.app.project }} | |
| - name: Run Trivy vulnerability scanner | |
| uses: aquasecurity/trivy-action@0.34.0 | |
| with: | |
| image-ref: ghcr.io/${{ github.repository_owner }}/binancebot-${{ matrix.app.name }}:latest | |
| format: 'table' | |
| ignore-unfixed: true | |
| vuln-type: 'library' | |
| severity: 'CRITICAL,HIGH' |