Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ecd2033
refactor: encapsulate deployments in project folders
Jan 28, 2026
71379f8
fix: correct tar command syntax in pr-preview workflow
pablopunk Jan 29, 2026
99f067b
run review on selfhost
pablopunk Jan 29, 2026
51d2a2d
no more free
pablopunk Jan 29, 2026
90a41fc
lets try this
Jan 29, 2026
3fa7f02
fix: address critical bugs in deployment refactor
Jan 29, 2026
b5046f1
tmp dir
Jan 29, 2026
bd06482
chore: switch all workflows from glm-4.7 to kimi-k2.5
Jan 29, 2026
29b35fe
chore: use random HOME directory in opencode-review workflow
Jan 29, 2026
53ef58b
fix: run build from preview directory (not src/) to find node_modules
Jan 29, 2026
ca33af7
fix db
pablopunk Jan 29, 2026
0820436
fix: use correct preview path for docker compose commands
pablopunk Jan 29, 2026
2da7a9b
fix: add --env-file flag to docker compose to load env from parent di…
pablopunk Jan 29, 2026
4b764c8
fix: use absolute path for --env-file flag
pablopunk Jan 29, 2026
18da7a1
kimi
pablopunk Jan 29, 2026
e1cce1c
fix: ensure log streaming works after server restarts
pablopunk Jan 29, 2026
7c5284f
refactor: improve opencode workflow security and efficiency
pablopunk Feb 7, 2026
379370f
Merge remote-tracking branch 'origin/main' into sprint1-deployment-re…
pablopunk Feb 7, 2026
f6c2a8e
Merge remote-tracking branch 'origin/main' into sprint1-deployment-re…
pablopunk Feb 15, 2026
548f7b4
Merge branch 'sprint1-deployment-refactor' of github.com:pablopunk/do…
pablopunk Feb 15, 2026
7035cd9
refactor: harden deployment flow and model config paths
pablopunk Feb 15, 2026
076ca9b
Merge branch 'sprint1-deployment-refactor' of github.com:pablopunk/do…
pablopunk Feb 15, 2026
8ab9928
Update model configuration and selector improvements
pablopunk Feb 15, 2026
fac974b
fix: install bash in runtime image and show bootstrap errors
pablopunk Feb 15, 2026
f2a2816
update agents
pablopunk Feb 15, 2026
269f700
perf(ci): enable buildkit for pr preview rebuild
pablopunk Feb 15, 2026
be1be2b
ignore
pablopunk Feb 15, 2026
f4d640f
opencode 1.2.5
pablopunk Feb 15, 2026
d381d7e
chore: auto-cleanup stale PR previews by checking GitHub for open PRs
pablopunk Feb 15, 2026
11c5b69
feat: add OpenCode error observability in UI
pablopunk Feb 16, 2026
07ca1e2
fix: add GH_TOKEN env for gh CLI in deploy job
pablopunk Feb 16, 2026
4489b83
minimal debug scenario
pablopunk Feb 16, 2026
00021d3
no need
pablopunk Feb 16, 2026
812ee18
feat: add per-job queue log streaming
pablopunk Feb 16, 2026
348cb54
fix: mark production ready when container is healthy
pablopunk Feb 16, 2026
b972587
fix: map production URL to current host
pablopunk Feb 16, 2026
26a9b78
fix vendor matching
pablopunk Feb 16, 2026
154078c
pnpm format
pablopunk Feb 16, 2026
3be7a3f
make sure docker stuff is good before creating a project
pablopunk Feb 16, 2026
42ff75c
fix docker again i guess
pablopunk Feb 16, 2026
db54fe5
fix file browser path
pablopunk Feb 16, 2026
86adab6
unused import
pablopunk Feb 16, 2026
0d8c36a
fix assets
pablopunk Feb 16, 2026
ae8b5a3
mobile view
pablopunk Feb 17, 2026
946f285
no version
pablopunk Feb 17, 2026
cccb200
prune
pablopunk Feb 17, 2026
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
58 changes: 58 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Version control
.git
.gitignore

# Dependencies (rebuilt in build stage)
node_modules

# Build outputs (rebuilt in build stage)
dist

# Runtime data
data

# Environment files
.env
.env.*
!.env.example

# Logs
*.log
npm-debug.log*
pnpm-debug.log*

# OS files
.DS_Store
Thumbs.db

# Agent artifacts
.sisyphus

# CI/CD workflows
.github

# IDE
.idea
.vscode
*.swp
*.swo

# Documentation (not needed in image)
README.md
AGENTS.md
CONTRIBUTING.md
LICENSE

# Test files
*.test.ts
*.test.tsx
*.spec.ts
*.spec.tsx
__tests__
coverage
.e2e

# Docker files (not needed in image)
Dockerfile
docker-compose.yml
.dockerignore
2 changes: 2 additions & 0 deletions .github/workflows/opencode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ jobs:
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_PERMISSION: '{"bash": "deny"}'
with:
model: opencode/kimi-k2.5
model: opencode/minimax-m2.5
67 changes: 55 additions & 12 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
permissions:
contents: read
pull-requests: write
env:
GH_TOKEN: ${{ github.token }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -53,6 +55,10 @@ jobs:
chmod 700 ~/.ssh
ssh-keyscan -H doce.pangolin-frog.ts.net >> ~/.ssh/known_hosts 2>/dev/null || true

- name: Docker cleanup
run: |
ssh root@doce.pangolin-frog.ts.net "docker system prune -af --volumes || true"

- name: Deploy preview
id: deploy
run: |
Expand All @@ -66,8 +72,42 @@ jobs:

echo "🚀 Deploying PR #$PR_NUM to $VM_HOST"

# Step 1: Clean up stale previews
echo "📦 Cleaning up stale previews..."
# Step 1: Clean up stale previews for closed PRs
echo "🧹 Cleaning up stale previews..."

# Get list of open PR numbers from GitHub
OPEN_PRS=$(gh pr list --state open --json number --jq '.[].number')

# Get list of existing PR directories on server
EXISTING_DIRS=$(ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"ls -d /root/previews/pr-* 2>/dev/null | xargs -n1 basename 2>/dev/null || true")

# For each existing directory, check if the PR is still open
for dir in $EXISTING_DIRS; do
DIR_PR_NUM=$(echo "$dir" | sed 's/pr-//')
IS_OPEN=false
for open_pr in $OPEN_PRS; do
if [ "$DIR_PR_NUM" = "$open_pr" ]; then
IS_OPEN=true
break
fi
done

if [ "$IS_OPEN" = "false" ]; then
echo "🗑️ Cleaning up stale preview for PR #$DIR_PR_NUM (PR is closed)"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"cd /root/previews/$dir && docker-compose down 2>/dev/null || true"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"$SCRIPTS_DIR/release-port.sh $DIR_PR_NUM 2>/dev/null || true"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"docker rmi -f doce-pr-$DIR_PR_NUM:latest 2>/dev/null || true"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"rm -rf /root/previews/$dir"
fi
done

# Also clean up any leftover containers from previous runs of this PR
echo "📦 Cleaning up stale containers for PR #$PR_NUM..."
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"docker rm -f doce-pr-$PR_NUM 2>/dev/null || true; cd /root/previews && for dir in pr-*; do [ -d \"\$dir\" ] && (cd \"\$dir\" && docker-compose down 2>/dev/null || true) || true; done"

Expand All @@ -85,10 +125,10 @@ jobs:
ssh -o StrictHostKeyChecking=no $SSH_USER@$VM_HOST \
"docker volume create doce-global-pnpm-store 2>/dev/null || true"

# Step 3: Copy PR code to VM via tar
echo "📋 Copying PR code..."
tar czf - . --exclude=node_modules --exclude=.git --exclude=dist --exclude=data | \
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "cd \"$REPO_DIR\" && tar xzf -"
# Step 3: Copy PR code to VM via tar
echo "📋 Copying PR code..."
tar czf - --exclude=node_modules --exclude=.git --exclude=dist --exclude=data . | \
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "cd \"$REPO_DIR\" && tar xzf -"

# Step 4: Allocate port
echo "🔌 Allocating port..."
Expand All @@ -100,8 +140,10 @@ jobs:

if [ "$DOCKERFILE_CHANGED" = "true" ]; then
echo "🔨 Building Docker image (Dockerfile changed)..."
echo "⏱️ Build started at $(date)"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"cd \"$REPO_DIR\" && docker build -t doce-pr-$PR_NUM:latest ."
"cd \"$REPO_DIR\" && DOCKER_BUILDKIT=1 docker build -t doce-pr-$PR_NUM:latest ."
echo "⏱️ Build completed at $(date)"
else
echo "📥 Pulling pre-built image from registry (Dockerfile unchanged)..."
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
Expand Down Expand Up @@ -202,17 +244,18 @@ jobs:

echo "🧹 Cleaning up PR #$PR_NUM preview"

# Stop containers (ignore if directory doesn't exist)
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"cd \"$PR_DIR\" && docker-compose down 2>/dev/null || true"
"[ -d \"$PR_DIR\" ] && cd \"$PR_DIR\" && docker-compose down 2>/dev/null || true"

ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "$SCRIPTS_DIR/release-port.sh $PR_NUM"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "$SCRIPTS_DIR/release-port.sh $PR_NUM 2>/dev/null || true"

ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "docker rmi -f doce-pr-$PR_NUM:latest || true"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "docker rmi -f doce-pr-$PR_NUM:latest 2>/dev/null || true"

ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" \
"docker image prune -a --force" || true
"docker system prune -af --volumes 2>/dev/null || true"

ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "rm -rf \"$PR_DIR\" || true"
ssh -o StrictHostKeyChecking=no "$SSH_USER@$VM_HOST" "rm -rf \"$PR_DIR\" 2>/dev/null || true"

echo "✅ PR preview cleaned up!"

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ coverage/

# Astro
.astro

# Agent artifacts
.sisyphus
Loading
Loading