Repository navigation
chore: add Superset workspace setup/run config #255
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: Build and Push Docker Image | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set up Deno | |
| uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5 | |
| with: | |
| deno-version: 2.9.5 | |
| cache: true | |
| - name: Lint | |
| run: npm run lint | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Test | |
| run: npm test -- --coverage | |
| - name: Edge function tests | |
| run: npm run test:edge | |
| - name: Build | |
| run: npm run build | |
| - name: Upload production assets | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: production-assets-${{ github.sha }} | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 1 | |
| database-tests: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 22 | |
| - name: Set up Supabase CLI | |
| uses: supabase/setup-cli@46f7f98c7f948ad727d22c1e67fab04c223a0520 # v3.0.0 | |
| with: | |
| version: 2.115.0 | |
| - name: Start isolated database and apply migrations | |
| run: supabase db start | |
| - name: Database policy tests | |
| run: npm run test:db | |
| - name: Stop isolated database | |
| if: always() | |
| run: supabase stop --no-backup | |
| browser-tests: | |
| if: github.event_name == 'pull_request' | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Chromium | |
| run: npx playwright install --with-deps chromium | |
| - name: Browser tests | |
| env: | |
| CI: 1 | |
| PORT: 18080 | |
| PLAYWRIGHT_BASE_URL: http://127.0.0.1:18080 | |
| run: npm run test:e2e | |
| - name: Upload browser failure artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: chromium-browser-failure-${{ github.run_id }} | |
| path: | | |
| test-results/ | |
| playwright-report/ | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| docker: | |
| if: github.event_name != 'pull_request' | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCKER_PUSH: ${{ github.event_name == 'push' && secrets.DOCKER_USERNAME != '' && secrets.DOCKER_PASSWORD != '' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Download production assets | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: production-assets-${{ github.sha }} | |
| path: dist/ | |
| - name: Set up QEMU | |
| if: env.DOCKER_PUSH == 'true' | |
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 | |
| - name: Set up Docker Buildx | |
| if: env.DOCKER_PUSH == 'true' | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| - name: Login to Docker Hub | |
| if: env.DOCKER_PUSH == 'true' | |
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| # Create a minimal Dockerfile for multi-arch that just uses pre-built assets | |
| - name: Create production Dockerfile | |
| if: env.DOCKER_PUSH == 'true' | |
| run: | | |
| cat > Dockerfile.prod << 'EOF' | |
| FROM nginx:alpine | |
| RUN rm -rf /usr/share/nginx/html/* | |
| COPY dist /usr/share/nginx/html | |
| COPY nginx.conf /etc/nginx/conf.d/default.conf | |
| EXPOSE 80 | |
| CMD ["nginx", "-g", "daemon off;"] | |
| EOF | |
| - name: Build and push | |
| if: env.DOCKER_PUSH == 'true' | |
| uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5 | |
| with: | |
| context: . | |
| file: Dockerfile.prod | |
| push: ${{ env.DOCKER_PUSH == 'true' }} | |
| tags: adamgaborjaniszabo/debate-trainer:latest | |
| platforms: linux/amd64,linux/arm64 |