chore: add all latest updates (Docker, frontend, docs, run script) #33
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 & Security | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'apps/backend/Dockerfile' | |
| - 'apps/ai-worker/Dockerfile' | |
| - 'docker/**' | |
| - 'docker-compose*' | |
| - '.github/workflows/docker-build.yml' | |
| - '.dockerignore' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'apps/backend/Dockerfile' | |
| - 'apps/ai-worker/Dockerfile' | |
| - 'docker/**' | |
| - 'docker-compose*' | |
| - '.github/workflows/docker-build.yml' | |
| - '.dockerignore' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-backend: | |
| name: Build Backend Image | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge pull request')) | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free Disk Space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /usr/share/dotnet | |
| sudo apt-get clean | |
| df -h | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build backend image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./apps/backend/Dockerfile | |
| push: false | |
| load: true | |
| tags: ragbase/backend:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run Trivy security scan | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: ragbase/backend:test | |
| format: 'sarif' | |
| output: 'trivy-backend.sarif' | |
| - name: Upload Trivy results | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: 'trivy-backend.sarif' | |
| build-ai-worker: | |
| name: Build AI Worker Image | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge pull request')) | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free Disk Space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /usr/share/dotnet | |
| sudo apt-get clean | |
| df -h | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build ai-worker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./apps/ai-worker/Dockerfile | |
| push: false | |
| load: true | |
| tags: ragbase/ai-worker:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run Trivy security scan | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: ragbase/ai-worker:test | |
| format: 'sarif' | |
| output: 'trivy-ai-worker.sarif' | |
| - name: Upload Trivy results | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: 'trivy-ai-worker.sarif' | |