Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:

- run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm run lint
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium

- name: Type check
run: pnpm run check
- name: Checks
run: pnpm run checks

- name: Test
run: pnpm run test
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy

on:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v5
with:
version: 10

- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: Build
run: pnpm run build

- name: Deploy to Cloudflare Workers
run: pnpm exec wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
28 changes: 28 additions & 0 deletions .github/workflows/preview-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v5
with:
version: 10

- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: Delete preview alias
run: pnpm exec wrangler versions delete-alias pr-${{ github.event.pull_request.number }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
54 changes: 54 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Preview Deploy

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
preview:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v5
with:
version: 10

- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm

- run: pnpm install --frozen-lockfile

- name: Build
run: pnpm run build

- name: Deploy preview
run: pnpm exec wrangler versions upload --preview-alias pr-${{ github.event.pull_request.number }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Find existing comment
id: find-comment
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Preview Deployed

- name: Post preview link comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
**Preview Deployed!**

Preview your changes at: https://pr-${{ github.event.pull_request.number }}-github-activity-dashboard.${{ secrets.CLOUDFLARE_WORKERS_SUBDOMAIN }}.workers.dev

This preview will be automatically deleted when the PR is closed.
edit-mode: replace
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
"build": "vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"types:check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"types:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "eslint . && prettier --check .",
"format": "prettier --write . && eslint --fix .",
"format:check": "prettier --check .",
"test:unit": "vitest",
"test": "pnpm run test:unit --run",
"format:check": "prettier --check ."
"checks": "pnpm run types:check && pnpm run lint"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20260317.1",
Expand All @@ -38,7 +39,8 @@
"typescript-eslint": "^8.54.0",
"vite": "^7.3.1",
"vitest": "^4.1.0",
"vitest-browser-svelte": "^2.0.2"
"vitest-browser-svelte": "^2.0.2",
"wrangler": "^4.77.0"
},
"dependencies": {
"@sveltejs/adapter-cloudflare": "^7.2.8",
Expand Down
25 changes: 14 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading