Skip to content
Draft
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
10 changes: 10 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"permissions": {
"allow": [
"Bash(gh api:*)",
"WebFetch(domain:docs.discord.com)",
"Bash(npm run biome*)",
"Bash(npx tsc *)"
]
}
}
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy

on:
workflow_dispatch:
push:
tags:
- '*.*.*'

jobs:
deploy-dev:
name: Deploy dev
runs-on: ubuntu-latest
environment: tvbot-dev
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- run: npm ci
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "4"
command: deploy --env dev

deploy-prod:
name: Deploy prod
needs: deploy-dev
runs-on: ubuntu-latest
environment: tvbot-prod
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- run: npm ci
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "4"
command: deploy --env prod
18 changes: 0 additions & 18 deletions .github/workflows/fly-deploy.yml

This file was deleted.

49 changes: 20 additions & 29 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Pull Request

on:
pull_request:
branches:
Expand All @@ -7,6 +8,7 @@ on:
- opened
- edited
- synchronize

jobs:
pr-title:
runs-on: ubuntu-latest
Expand All @@ -19,48 +21,37 @@ jobs:
with:
allowed_prefixes: 'Breaking:,Fix:,Update:,New:,Build:,Upgrade:,Chore:,NoBuild:'
prefix_case_sensitive: true

lint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
- run: deno lint
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci .

typecheck:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
- run: deno install --allow-scripts=npm:prisma,npm:@prisma/engines,npm:@prisma/client
- run: deno task typecheck
- uses: actions/checkout@v6
with:
persist-credentials: false
- run: npm ci
- run: npx tsc --noEmit

test-semantic-release:
uses: ./.github/workflows/semantic-release.yml
permissions:
contents: read
with:
dry_run: true
build_docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.github_token }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: build and push
uses: docker/build-push-action@v6
with:
tags: ghcr.io/cbackas/tvbot:pr-${{github.event.pull_request.number}}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
47 changes: 47 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: PR Preview

on:
pull_request:
branches:
- master
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

jobs:
preview:
name: Deploy preview
runs-on: ubuntu-latest
environment: tvbot-dev
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- run: npm ci
- id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "4"
command: versions upload --env dev --message "PR #${{ github.event.pull_request.number }}" --tag "pr-${{ github.event.pull_request.number }}"
- name: Extract preview URL
id: url
run: |
URL=$(echo "${{ steps.deploy.outputs.command-output }}" | grep -oE 'https://[a-z0-9-]+-tvbot-dev\.[a-z0-9.-]+\.workers\.dev' | head -n1)
if [ -z "$URL" ]; then
echo "Failed to extract preview URL from wrangler output" >&2
exit 1
fi
echo "url=$URL" >> "$GITHUB_OUTPUT"
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: preview
message: |
**Preview**: ${{ steps.url.outputs.url }}

Uploaded as `pr-${{ github.event.pull_request.number }}`. Shares the dev D1 — not traffic-routed. Re-uploads on every push.
42 changes: 0 additions & 42 deletions .github/workflows/tags.yml

This file was deleted.

Loading
Loading