diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 20bca47..63ae3f1 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -53,6 +53,17 @@ jobs: name: Build an image from Dockerfile run: | docker build --target backend-production -t docker.io/lasuite/meet-backend:${{ github.sha }} . + - + name: Get Date + id: get-date + run: | + echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT + shell: bash + - + uses: actions/cache@v4 + with: + path: /tmp/trivy + key: ${{ steps.get-date.outputs.date }} - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@0.20.0 @@ -63,6 +74,7 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' + cache-dir: /tmp/trivy - name: Build and push uses: docker/build-push-action@v5 @@ -73,6 +85,12 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - + uses: actions/cache/save@v3 + if: always() + with: + path: /tmp/trivy + key: ${{ steps.get-date.outputs.date }} build-and-push-frontend: runs-on: ubuntu-latest @@ -111,6 +129,17 @@ jobs: name: Build an image from Dockerfile run: | docker build -f src/frontend/Dockerfile -t docker.io/lasuite/meet-frontend:${{ github.sha }} . + - + name: Get Date + id: get-date + run: | + echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT + shell: bash + - + uses: actions/cache@v4 + with: + path: trivy + key: ${{ steps.get-date.outputs.date }} - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@0.20.0 @@ -121,6 +150,14 @@ jobs: ignore-unfixed: true vuln-type: 'os,library' severity: 'CRITICAL,HIGH' + cache-dir: trivy + - + name: Debug + if: always() + run: | + whoami; + chown -R 1001:127 trivy + shell: bash - name: Build and push uses: docker/build-push-action@v5 @@ -132,6 +169,12 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - + uses: actions/cache/save@v3 + if: always() + with: + path: trivy + key: ${{ steps.get-date.outputs.date }} notify-argocd: needs: