Merge pull request #193 from rajputomsingh/perf/listing-performance-o… #74
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: Docker Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set Up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: ${{ runner.os }}-buildx-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-buildx- | |
| - name: Build Docker Image | |
| run: | | |
| docker build \ | |
| --build-arg NEXT_PUBLIC_SUPABASE_URL="${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}" \ | |
| --build-arg NEXT_PUBLIC_SUPABASE_ANON_KEY="${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}" \ | |
| --build-arg SUPABASE_SERVICE_ROLE_KEY="${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}" \ | |
| --build-arg NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}" \ | |
| --build-arg CLERK_SECRET_KEY="${{ secrets.CLERK_SECRET_KEY }}" \ | |
| --build-arg DATABASE_URL="postgresql://postgres:password@postgres:5432/fieldly" \ | |
| -t fieldly:latest \ | |
| -t fieldly:${{ github.sha }} \ | |
| . | |
| - name: Image Size Check | |
| run: | | |
| docker images fieldly:latest --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}" | |
| - name: Run Security Scan (Trivy) | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: fieldly:latest | |
| format: 'table' | |
| exit-code: '0' | |
| ignore-unfixed: true | |
| vuln-type: 'os,library' | |
| severity: 'CRITICAL,HIGH' |