Post screenshots of preview sites in PR comments #150
Workflow file for this run
This file contains 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 | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
- run: bun install --frozen-lockfile | |
- run: timeout 12s bun pre-commit | |
- run: bun run test | |
- run: ./check-lines.sh | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
- run: bun install --frozen-lockfile | |
- name: run playwright screenshots script | |
if: github.event_name == 'pull_request' | |
run: | | |
bun run dev & | |
while ! curl http://localhost:3000; do sleep 0.5; done > /dev/null | |
node src/ci/screenshots.cjs http://localhost:3000 public/images/ | |
kill -9 $(lsof -t -i:3000) | |
- run: bun run build | |
- name: Upload built project | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ./dist | |
overwrite: true | |
retention-days: 1 | |
name: build-artifacts-${{ github.run_id }} | |
- name: Deploy to Cloudflare Pages | |
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/new-connect' | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} | |
command: pages deploy dist --project-name=connect --branch=new-connect --commit-dirty=true |