Spaces:
Running

polats Claude Opus 5 (1M context) commited on
Commit
e85a4d4
Β·
1 Parent(s): 5bd2d41

Sync the HF Space from CI on every push to main

Browse files

Builds the image on a runner, boots it, and asserts the three things that
matter β€” it exits nonzero without OPENCODE_SERVER_PASSWORD, answers
/api/health with basic auth, and serves the web UI on / β€” before pushing
anything. A Dockerfile that only breaks on the Space would otherwise leave it
parked in BUILD_ERROR with no signal here.

The push is forced because GitHub is the source of truth; a hand-edit in the
Space's web UI should not be able to block a deploy. The HF username is derived
from the token via whoami rather than stored, which also turns a bad token into
a clear error instead of an opaque git failure. Finally the job polls the Space
until it reports RUNNING so a red check means a broken deploy, not just a
failed push.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

2 files changed +150
Files changed (2)
.github/workflows/sync-to-hf-space.ymlAdded+130
README.md+20