Repository navigation
ci: publish preview fixtures to R2 instead of main #267
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: Preview build | |
| # Separate from CI so preview-deploy.yml does not wait for the slow test job. | |
| on: | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| site: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version-file: package.json | |
| - run: bun install --frozen-lockfile | |
| - run: bun run site:build | |
| env: | |
| SITE_PREVIEW_PR: ${{ github.event.number }} | |
| # Function tests would become routes, so they stay out. | |
| - run: | | |
| mkdir -p preview/site/functions | |
| cp -R apps/site/dist preview/site/dist | |
| (cd apps/site/functions && find . -name '*.ts' ! -name '*.test.ts' -exec cp --parents {} ../../../preview/site/functions/ \;) | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: site-preview | |
| path: preview/site | |
| retention-days: 3 | |
| if-no-files-found: error | |
| app: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version-file: package.json | |
| - run: bun install --frozen-lockfile | |
| - run: bun --bun run --cwd apps/desktop build-preview | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: app-preview | |
| path: apps/desktop/out/preview | |
| retention-days: 3 | |
| if-no-files-found: error |