Build Website #5
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 Website | |
| # Builds and deploys the browser/WASM ffsubsync site to GitHub Pages | |
| # (https://smacke.github.io/ffsubsync). build-wheels cross-compiles the webrtcvad | |
| # wasm wheel (exact CLI-parity VAD) and feeds it into build-site; if that build | |
| # fails, the site still deploys and falls back to the pure-Python auditok VAD. | |
| # | |
| # To deploy on demand: Actions -> build-site -> "Run workflow" (workflow_dispatch), | |
| # targeting master. Pushes to master that touch web/ or ffsubsync/ also deploy. | |
| # (workflow_dispatch is only offered for workflows present on the default branch, | |
| # so this file must be on master to trigger it there.) | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: build-site-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-native: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - name: Native correctness test (sub-vs-sub) | |
| run: make -C web test | |
| - name: Native correctness test (audio path) | |
| run: make -C web test-audio | |
| build-wheels: | |
| runs-on: ubuntu-latest | |
| # A wheel-build hiccup must not block deploying the (auditok-capable) site. | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| # Pyodide 0.28.x's cross-build env requires a 3.13 host interpreter. | |
| python-version: "3.13" | |
| - name: Build webrtcvad wasm wheel | |
| run: make -C web wheels | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: webrtcvad-wheel | |
| path: web/vendor/wheels/*.whl | |
| if-no-files-found: warn | |
| test-browser: | |
| runs-on: ubuntu-latest | |
| # The audio browser test needs the webrtcvad wheel; pull it from build-wheels. | |
| needs: [build-wheels] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Fetch webrtcvad wheel (for the audio-path test) | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: webrtcvad-wheel | |
| path: web/vendor/wheels | |
| - name: Install Playwright | |
| working-directory: web | |
| run: | | |
| npm install | |
| npx playwright install --with-deps chromium | |
| - name: Headless browser tests (sub-vs-sub + audio path) | |
| run: make -C web test-browser | |
| build-site: | |
| runs-on: ubuntu-latest | |
| needs: [test-native, build-wheels] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Fetch webrtcvad wheel (if built) | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: webrtcvad-wheel | |
| path: web/vendor/wheels | |
| - name: Assemble static bundle | |
| run: make -C web site | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: web/dist/site | |
| deploy: | |
| # Deploy on a push to master, or any manual run (workflow_dispatch). | |
| if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| needs: [build-site, test-browser] | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |