Media analytics N+1 query #324
Workflow file for this run
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: π Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| tags: | |
| - 'v*' | |
| pull_request: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| actions: write | |
| contents: read | |
| jobs: | |
| lint: | |
| name: ⬣ Lint | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: π¦ Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: π₯ Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: π¬ Lint | |
| run: bun run check:ci | |
| typecheck: | |
| name: Κ¦ TypeCheck | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: π¦ Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: π₯ Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: π Type check | |
| run: bun run typecheck | |
| test: | |
| name: π§ͺ Test | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: π¦ Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: π₯ Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: π§ͺ Run tests | |
| run: bun test | |
| build: | |
| name: π³ Build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: π³ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: ποΈ Build Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| load: true | |
| tags: mediarss:smoke-test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| COMMIT_SHA=${{ github.sha }} | |
| - name: π§ͺ Smoke test | |
| run: | | |
| # Start the container | |
| docker run -d --name smoke-test -p 22050:22050 mediarss:smoke-test | |
| # Wait for the container to be ready (max 30 seconds) | |
| for i in {1..30}; do | |
| if curl -sf http://localhost:22050/admin/health > /dev/null 2>&1; then | |
| echo "β Health check passed!" | |
| curl -s http://localhost:22050/admin/health | jq . | |
| docker stop smoke-test | |
| docker rm smoke-test | |
| exit 0 | |
| fi | |
| echo "Waiting for container... ($i/30)" | |
| sleep 1 | |
| done | |
| echo "β Health check failed!" | |
| docker logs smoke-test | |
| docker stop smoke-test | |
| docker rm smoke-test | |
| exit 1 | |
| publish: | |
| name: π Publish | |
| runs-on: ubuntu-22.04 | |
| needs: [lint, typecheck, test, build] | |
| if: ${{ github.event_name == 'push' }} | |
| steps: | |
| - name: β¬οΈ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: π³ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: π Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: π Generate Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ secrets.DOCKERHUB_USERNAME }}/mediarss | |
| tags: | | |
| type=ref,event=branch | |
| type=sha,format=long | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} | |
| type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} | |
| type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} | |
| - name: π Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| COMMIT_SHA=${{ github.sha }} |