Skip to content

Commit af00baa

Browse files
tianzhouclaude
andcommitted
feat: deploy demo.pgconsole.com via Cloudflare Containers
Add a Cloudflare Worker that proxies traffic to a pgconsole container running in demo mode. Deployment chains off the Docker Hub publish workflow, using the package.json version as the image tag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5626850 commit af00baa

6 files changed

Lines changed: 940 additions & 0 deletions

File tree

.github/workflows/deploy-demo.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy Demo
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Publish to Docker Hub"]
6+
types: [completed]
7+
branches: [main]
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Get version from package.json
19+
id: version
20+
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
21+
22+
- name: Update image tag in wrangler.toml
23+
run: sed -i "s|pgplex/pgconsole:[^ \"]*|pgplex/pgconsole:${{ steps.version.outputs.VERSION }}|" worker/demo/wrangler.toml
24+
25+
- name: Deploy to Cloudflare
26+
uses: cloudflare/wrangler-action@v3
27+
with:
28+
workingDirectory: worker/demo
29+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
30+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

worker/demo/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "pgconsole-demo",
3+
"private": true,
4+
"scripts": {
5+
"dev": "wrangler dev",
6+
"deploy": "wrangler deploy"
7+
},
8+
"devDependencies": {
9+
"@cloudflare/containers": "^0.1",
10+
"wrangler": "^4"
11+
}
12+
}

0 commit comments

Comments
 (0)