Skip to content

fix trivy path

fix trivy path #3

Workflow file for this run

name: Docker Image CI
on:
push:
tags:
- 'v*'
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract tag
id: extract_tag
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag ghcr.io/aio-it/mmchatgpt:${{ env.TAG }}
docker tag ghcr.io/aio-it/mmchatgpt:${{ env.TAG }} ghcr.io/aio-it/mmchatgpt:latest
- name: Run Trivy scan on specific tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -
./bin/trivy image ghcr.io/aio-it/mmchatgpt:${{ env.TAG }}
- name: Run Trivy scan on latest tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./bin/trivy image ghcr.io/aio-it/mmchatgpt:latest
- name: Push the Docker image with specific tag
run: docker push ghcr.io/aio-it/mmchatgpt:${{ env.TAG }}
- name: Push the Docker image with latest tag
run: docker push ghcr.io/aio-it/mmchatgpt:latest