Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
name: Deploy Worker
on:
push:
branches: [main]
paths:
- "web/**"
- ".github/workflows/deploy-worker.yml"
workflow_dispatch:
inputs:
environment:
description: "Environment to deploy to"
required: true
default: "beta"
type: choice
options:
- beta
- production
concurrency:
group: deploy-${{ github.event.inputs.environment || 'beta' }}
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.environment || 'beta' }}
url: ${{ github.event.inputs.environment == 'production' && 'https://grokicad.com' || 'https://beta.grokicad.com' }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.5"
- name: Install & validate
working-directory: web
run: |
bun install --frozen-lockfile
bun run worker:types
bun run lint:types
- name: Build assets
working-directory: web
run: bun run build
- name: Deploy to Cloudflare
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
environment: ${{ github.event.inputs.environment || 'beta' }}
workingDirectory: web
- name: Summary
run: |
ENV="${{ github.event.inputs.environment || 'beta' }}"
if [ "$ENV" = "production" ]; then
echo "## 🚀 Production Deployment" >> $GITHUB_STEP_SUMMARY
echo "- **URL:** https://grokicad.com" >> $GITHUB_STEP_SUMMARY
else
echo "## ✅ Beta Deployment" >> $GITHUB_STEP_SUMMARY
echo "- **URL:** https://beta.grokicad.com" >> $GITHUB_STEP_SUMMARY
fi
echo "- **Commit:** \`${GITHUB_SHA::7}\`" >> $GITHUB_STEP_SUMMARY
cc8ba99c0This file is pinned to the selected release. Download the original to open it in your design tool.