Skip to content

Commit c18e375

Browse files
hotlongCopilot
andcommitted
chore: bump @object-ui to 4.7.0 + add Cloudflare Containers deploy workflow
@object-ui 4.7.0 published with the lookup-param dialog fix (upstream commit 734b2ba4) — drops the previous store-overlay hack we used during local verification. apps/account and apps/console now resolve clean. .github/workflows/deploy.yml — new workflow: - Triggers: workflow_dispatch (choose cloud | objectos | both) OR push of a tag matching deploy-{cloud,objectos,all}-*. - Builds linux/amd64 image on native Ubuntu runner (no QEMU emulation like the local macOS path), pushes to registry.cloudflare.com using docker/build-push-action with GHA cache. First build takes the same time as local; subsequent cached builds drop to ~3-6 min. - Pins the resulting <sha8> tag into apps/<target>/wrangler.toml, runs 'wrangler deploy', then commits the pinned tag back to main (fast-forward only — never force-pushes). If main has moved, opens a branch instead. - Required secrets: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e02d3fc commit c18e375

4 files changed

Lines changed: 613 additions & 342 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
name: Deploy to Cloudflare Containers
2+
3+
# ─────────────────────────────────────────────────────────────────────────
4+
# Build + push Docker images for cloud (cloud.objectos.app) and/or
5+
# objectos (single-project runtime per env), then `wrangler deploy` the
6+
# matching Worker so the new image is pinned.
7+
#
8+
# Triggers:
9+
# 1. Manual: Actions → "Deploy to Cloudflare Containers" → Run
10+
# (choose `target` = cloud | objectos | both, and optionally
11+
# the commit SHA to deploy; defaults to the workflow ref).
12+
# 2. Tag: push a tag matching `deploy-cloud-*`, `deploy-objectos-*`,
13+
# or `deploy-all-*`. The tag suffix is informational; the
14+
# image tag = the resolved commit SHA (short, 8 chars) so a
15+
# redeploy of the same SHA is idempotent.
16+
#
17+
# Image naming:
18+
# registry.cloudflare.com/<ACCOUNT_ID>/objectstack-cloud:<sha8>
19+
# registry.cloudflare.com/<ACCOUNT_ID>/objectos:<sha8>
20+
#
21+
# The corresponding `apps/<target>/wrangler.toml` is rewritten in-place to
22+
# pin `image = "<registry>:<sha8>"` and committed back to `main` so the
23+
# repo always tracks what is actually deployed.
24+
#
25+
# Required secrets (Repository → Settings → Secrets and variables → Actions):
26+
# CLOUDFLARE_API_TOKEN — token with Containers:Edit + Workers:Edit perms
27+
# CLOUDFLARE_ACCOUNT_ID — 2846eb40a60f4738e292b90dcd8cce10
28+
# ─────────────────────────────────────────────────────────────────────────
29+
30+
on:
31+
workflow_dispatch:
32+
inputs:
33+
target:
34+
description: 'Which app(s) to deploy'
35+
required: true
36+
default: 'both'
37+
type: choice
38+
options:
39+
- cloud
40+
- objectos
41+
- both
42+
ref:
43+
description: 'Commit SHA or branch to deploy (default: workflow ref)'
44+
required: false
45+
default: ''
46+
push:
47+
tags:
48+
- 'deploy-cloud-*'
49+
- 'deploy-objectos-*'
50+
- 'deploy-all-*'
51+
52+
concurrency:
53+
# Serialize deploys per-target so two pushes don't race on `wrangler deploy`.
54+
group: deploy-${{ github.event.inputs.target || github.ref_name }}
55+
cancel-in-progress: false
56+
57+
jobs:
58+
# ── Resolve which targets to build based on the trigger ──
59+
plan:
60+
runs-on: ubuntu-latest
61+
outputs:
62+
deploy_cloud: ${{ steps.plan.outputs.deploy_cloud }}
63+
deploy_objectos: ${{ steps.plan.outputs.deploy_objectos }}
64+
sha: ${{ steps.plan.outputs.sha }}
65+
sha8: ${{ steps.plan.outputs.sha8 }}
66+
steps:
67+
- name: Checkout (resolve ref)
68+
uses: actions/checkout@v5
69+
with:
70+
ref: ${{ github.event.inputs.ref || github.ref }}
71+
fetch-depth: 1
72+
73+
- id: plan
74+
name: Plan targets + resolve SHA
75+
run: |
76+
set -euo pipefail
77+
SHA="$(git rev-parse HEAD)"
78+
SHA8="$(git rev-parse --short=8 HEAD)"
79+
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
80+
echo "sha8=$SHA8" >> "$GITHUB_OUTPUT"
81+
82+
DEPLOY_CLOUD=false
83+
DEPLOY_OBJECTOS=false
84+
case "${{ github.event_name }}" in
85+
workflow_dispatch)
86+
T="${{ github.event.inputs.target }}"
87+
[[ "$T" == "cloud" || "$T" == "both" ]] && DEPLOY_CLOUD=true
88+
[[ "$T" == "objectos" || "$T" == "both" ]] && DEPLOY_OBJECTOS=true
89+
;;
90+
push)
91+
REF="${{ github.ref_name }}"
92+
[[ "$REF" == deploy-cloud-* || "$REF" == deploy-all-* ]] && DEPLOY_CLOUD=true
93+
[[ "$REF" == deploy-objectos-* || "$REF" == deploy-all-* ]] && DEPLOY_OBJECTOS=true
94+
;;
95+
esac
96+
97+
echo "deploy_cloud=$DEPLOY_CLOUD" >> "$GITHUB_OUTPUT"
98+
echo "deploy_objectos=$DEPLOY_OBJECTOS" >> "$GITHUB_OUTPUT"
99+
echo "─────────────────────────────────"
100+
echo "Trigger: ${{ github.event_name }}"
101+
echo "SHA: $SHA"
102+
echo "Image tag: $SHA8"
103+
echo "Cloud: $DEPLOY_CLOUD"
104+
echo "ObjectOS: $DEPLOY_OBJECTOS"
105+
106+
# ── Build + push cloud image; pin tag in wrangler.toml; wrangler deploy ──
107+
cloud:
108+
needs: plan
109+
if: needs.plan.outputs.deploy_cloud == 'true'
110+
runs-on: ubuntu-latest
111+
permissions:
112+
contents: write # to commit the wrangler.toml tag bump back to main
113+
env:
114+
ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
115+
IMAGE_NAME: objectstack-cloud
116+
SHA8: ${{ needs.plan.outputs.sha8 }}
117+
steps:
118+
- uses: actions/checkout@v5
119+
with:
120+
ref: ${{ needs.plan.outputs.sha }}
121+
# Need full history so we can push back the tag-bump commit.
122+
fetch-depth: 0
123+
token: ${{ secrets.GITHUB_TOKEN }}
124+
125+
- name: Set up Docker Buildx
126+
uses: docker/setup-buildx-action@v3
127+
128+
- name: Log in to Cloudflare container registry
129+
uses: docker/login-action@v3
130+
with:
131+
registry: registry.cloudflare.com
132+
username: ${{ env.ACCOUNT_ID }}
133+
password: ${{ secrets.CLOUDFLARE_API_TOKEN }}
134+
135+
- name: Build + push cloud image
136+
uses: docker/build-push-action@v6
137+
with:
138+
context: .
139+
file: apps/cloud/Dockerfile
140+
platforms: linux/amd64
141+
push: true
142+
tags: registry.cloudflare.com/${{ env.ACCOUNT_ID }}/${{ env.IMAGE_NAME }}:${{ env.SHA8 }}
143+
# GitHub Actions cache — drops cloud rebuild from ~20m to ~3-6m
144+
# after the first run.
145+
cache-from: type=gha,scope=cloud
146+
cache-to: type=gha,scope=cloud,mode=max
147+
148+
- name: Pin image tag in wrangler.toml
149+
run: |
150+
set -euo pipefail
151+
NEW="registry.cloudflare.com/${ACCOUNT_ID}/${IMAGE_NAME}:${SHA8}"
152+
sed -i -E "s#^image = .*${IMAGE_NAME}:.*#image = \"${NEW}\"#" apps/cloud/wrangler.toml
153+
echo "Pinned to: $NEW"
154+
grep '^image' apps/cloud/wrangler.toml
155+
156+
- name: Wrangler deploy (cloud)
157+
uses: cloudflare/wrangler-action@v3
158+
with:
159+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
160+
accountId: ${{ env.ACCOUNT_ID }}
161+
workingDirectory: apps/cloud
162+
command: deploy --config wrangler.toml
163+
164+
- name: Commit pinned tag back to main
165+
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
166+
run: |
167+
set -euo pipefail
168+
if git diff --quiet apps/cloud/wrangler.toml; then
169+
echo "No tag change to commit."
170+
exit 0
171+
fi
172+
git config user.name "github-actions[bot]"
173+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
174+
git checkout -B deploy/cloud-${SHA8}
175+
git add apps/cloud/wrangler.toml
176+
git commit -m "chore(deploy): pin cloud image tag to ${SHA8}
177+
178+
Auto-bumped by .github/workflows/deploy.yml after successful Cloudflare
179+
Containers deploy of registry.cloudflare.com/${ACCOUNT_ID}/${IMAGE_NAME}:${SHA8}.
180+
181+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
182+
# Fast-forward push to main if possible; otherwise leave the branch
183+
# for a human to PR. We never force-push main.
184+
git fetch origin main
185+
if git merge-base --is-ancestor origin/main HEAD; then
186+
git push origin HEAD:main
187+
else
188+
git push origin HEAD
189+
echo "::warning::Could not fast-forward main; pushed branch deploy/cloud-${SHA8} instead. Open a PR."
190+
fi
191+
192+
# ── Build + push objectos image; pin tag; wrangler deploy ──
193+
objectos:
194+
needs: plan
195+
if: needs.plan.outputs.deploy_objectos == 'true'
196+
runs-on: ubuntu-latest
197+
permissions:
198+
contents: write
199+
env:
200+
ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
201+
IMAGE_NAME: objectos
202+
SHA8: ${{ needs.plan.outputs.sha8 }}
203+
steps:
204+
- uses: actions/checkout@v5
205+
with:
206+
ref: ${{ needs.plan.outputs.sha }}
207+
fetch-depth: 0
208+
token: ${{ secrets.GITHUB_TOKEN }}
209+
210+
- name: Set up Docker Buildx
211+
uses: docker/setup-buildx-action@v3
212+
213+
- name: Log in to Cloudflare container registry
214+
uses: docker/login-action@v3
215+
with:
216+
registry: registry.cloudflare.com
217+
username: ${{ env.ACCOUNT_ID }}
218+
password: ${{ secrets.CLOUDFLARE_API_TOKEN }}
219+
220+
- name: Build + push objectos image
221+
uses: docker/build-push-action@v6
222+
with:
223+
context: .
224+
file: apps/objectos/Dockerfile
225+
platforms: linux/amd64
226+
push: true
227+
tags: registry.cloudflare.com/${{ env.ACCOUNT_ID }}/${{ env.IMAGE_NAME }}:${{ env.SHA8 }}
228+
cache-from: type=gha,scope=objectos
229+
cache-to: type=gha,scope=objectos,mode=max
230+
231+
- name: Pin image tag in wrangler.toml
232+
run: |
233+
set -euo pipefail
234+
NEW="registry.cloudflare.com/${ACCOUNT_ID}/${IMAGE_NAME}:${SHA8}"
235+
sed -i -E "s#^image = .*${IMAGE_NAME}:.*#image = \"${NEW}\"#" apps/objectos/wrangler.toml
236+
echo "Pinned to: $NEW"
237+
grep '^image' apps/objectos/wrangler.toml
238+
239+
- name: Wrangler deploy (objectos)
240+
uses: cloudflare/wrangler-action@v3
241+
with:
242+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
243+
accountId: ${{ env.ACCOUNT_ID }}
244+
workingDirectory: apps/objectos
245+
command: deploy --config wrangler.toml
246+
247+
- name: Commit pinned tag back to main
248+
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
249+
run: |
250+
set -euo pipefail
251+
if git diff --quiet apps/objectos/wrangler.toml; then
252+
echo "No tag change to commit."
253+
exit 0
254+
fi
255+
git config user.name "github-actions[bot]"
256+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
257+
git checkout -B deploy/objectos-${SHA8}
258+
git add apps/objectos/wrangler.toml
259+
git commit -m "chore(deploy): pin objectos image tag to ${SHA8}
260+
261+
Auto-bumped by .github/workflows/deploy.yml after successful Cloudflare
262+
Containers deploy of registry.cloudflare.com/${ACCOUNT_ID}/${IMAGE_NAME}:${SHA8}.
263+
264+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
265+
git fetch origin main
266+
if git merge-base --is-ancestor origin/main HEAD; then
267+
git push origin HEAD:main
268+
else
269+
git push origin HEAD
270+
echo "::warning::Could not fast-forward main; pushed branch deploy/objectos-${SHA8} instead. Open a PR."
271+
fi

apps/account/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"preview": "vite preview"
1818
},
1919
"dependencies": {
20-
"@object-ui/i18n": "^4.6.0",
20+
"@object-ui/i18n": "^4.7.0",
2121
"@objectstack/client": "workspace:*",
2222
"@objectstack/client-react": "workspace:*",
2323
"@objectstack/spec": "workspace:*",

apps/console/package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@
1515
"preview": "vite preview"
1616
},
1717
"dependencies": {
18-
"@object-ui/app-shell": "^4.6.0",
19-
"@object-ui/auth": "^4.6.0",
20-
"@object-ui/collaboration": "^4.6.0",
21-
"@object-ui/components": "^4.6.0",
22-
"@object-ui/core": "^4.6.0",
23-
"@object-ui/data-objectstack": "^4.6.0",
24-
"@object-ui/fields": "^4.6.0",
25-
"@object-ui/i18n": "^4.6.0",
26-
"@object-ui/layout": "^4.6.0",
27-
"@object-ui/mobile": "^4.6.0",
28-
"@object-ui/permissions": "^4.6.0",
29-
"@object-ui/plugin-calendar": "^4.6.0",
30-
"@object-ui/plugin-charts": "^4.6.0",
31-
"@object-ui/plugin-chatbot": "^4.6.0",
32-
"@object-ui/plugin-dashboard": "^4.6.0",
33-
"@object-ui/plugin-designer": "^4.6.0",
34-
"@object-ui/plugin-detail": "^4.6.0",
35-
"@object-ui/plugin-form": "^4.6.0",
36-
"@object-ui/plugin-gantt": "^4.6.0",
37-
"@object-ui/plugin-grid": "^4.6.0",
38-
"@object-ui/plugin-kanban": "^4.6.0",
39-
"@object-ui/plugin-list": "^4.6.0",
40-
"@object-ui/plugin-map": "^4.6.0",
41-
"@object-ui/plugin-report": "^4.6.0",
42-
"@object-ui/plugin-timeline": "^4.6.0",
43-
"@object-ui/plugin-view": "^4.6.0",
44-
"@object-ui/react": "^4.6.0",
45-
"@object-ui/types": "^4.6.0",
18+
"@object-ui/app-shell": "^4.7.0",
19+
"@object-ui/auth": "^4.7.0",
20+
"@object-ui/collaboration": "^4.7.0",
21+
"@object-ui/components": "^4.7.0",
22+
"@object-ui/core": "^4.7.0",
23+
"@object-ui/data-objectstack": "^4.7.0",
24+
"@object-ui/fields": "^4.7.0",
25+
"@object-ui/i18n": "^4.7.0",
26+
"@object-ui/layout": "^4.7.0",
27+
"@object-ui/mobile": "^4.7.0",
28+
"@object-ui/permissions": "^4.7.0",
29+
"@object-ui/plugin-calendar": "^4.7.0",
30+
"@object-ui/plugin-charts": "^4.7.0",
31+
"@object-ui/plugin-chatbot": "^4.7.0",
32+
"@object-ui/plugin-dashboard": "^4.7.0",
33+
"@object-ui/plugin-designer": "^4.7.0",
34+
"@object-ui/plugin-detail": "^4.7.0",
35+
"@object-ui/plugin-form": "^4.7.0",
36+
"@object-ui/plugin-gantt": "^4.7.0",
37+
"@object-ui/plugin-grid": "^4.7.0",
38+
"@object-ui/plugin-kanban": "^4.7.0",
39+
"@object-ui/plugin-list": "^4.7.0",
40+
"@object-ui/plugin-map": "^4.7.0",
41+
"@object-ui/plugin-report": "^4.7.0",
42+
"@object-ui/plugin-timeline": "^4.7.0",
43+
"@object-ui/plugin-view": "^4.7.0",
44+
"@object-ui/react": "^4.7.0",
45+
"@object-ui/types": "^4.7.0",
4646
"clsx": "^2.1.1",
4747
"lucide-react": "^1.16.0",
4848
"react": "^19.2.6",

0 commit comments

Comments
 (0)