Skip to content

ci: auto-deploy main to HF Space on merge - #2

Merged
PrathikRavichandran merged 1 commit into
mainfrom
ci/deploy-hf
May 18, 2026
Merged

ci: auto-deploy main to HF Space on merge#2
PrathikRavichandran merged 1 commit into
mainfrom
ci/deploy-hf

Conversation

@PrathikRavichandran

Copy link
Copy Markdown
Owner

Summary

  • Adds .github/workflows/deploy-hf.yml to mirror main to huggingface.co/spaces/prathik10/pathways on every merge (and on manual workflow_dispatch). Eliminates the manual git push huggingface main step.
  • Force-pushes the full history because HF Spaces start from an unrelated initial commit and reject shallow pushes.
  • Polls /health for up to 10 minutes after the push, surfaces the result, but does NOT fail the build if HF's rebuild is still running — the push already succeeded by that point.

One-time setup before this works

  1. Create an HF access token with write scope: https://huggingface.co/settings/tokens
  2. Store it as a repo secret:
    gh secret set HF_TOKEN
    # paste the token when prompted
  3. (Optional) Override the Space coords with repo variables if you ever move the Space:
    gh variable set HF_SPACE_OWNER --body "prathik10"
    gh variable set HF_SPACE_NAME --body "pathways"
    Defaults match the live deploy, so this is only needed if you migrate.

First-run plan

After merging this PR, trigger the workflow manually once to validate:

gh workflow run deploy-hf.yml --ref main
gh run watch

That run will push every merged commit since the last manual HF push (which includes the map-view PR). Subsequent merges to main then auto-deploy.

Design choices worth flagging

  • Force-push, not merge. HF Spaces are not designed for two-way sync; treat the GitHub repo as source of truth. Any edits made directly in the HF web UI will be overwritten on the next merge — keep all changes in this repo. Documented inline in the workflow header.
  • Concurrency = 1, no cancel. A second merge while the first is still pushing queues instead of racing. HF rejects concurrent pushes anyway.
  • Health poll is fail-soft. A long HF rebuild (cold start, embed download retry) should not show as a failed deploy when the push itself succeeded. The workflow emits a ::warning:: and exits 0; you'll see it in the Actions tab.

Test plan

  • Merge this PR
  • gh secret set HF_TOKEN once
  • gh workflow run deploy-hf.yml --ref main -> first run pushes the backlog (map-view PR + this workflow itself)
  • Open https://prathik10-pathways.hf.space/dashboard/ to see if it boots
  • Open https://pathways-iota.vercel.app/, walk through intake -> housing query, confirm the map view appears above resource cards (PWA half is already live via Vercel)
  • Subsequent commits to main should auto-deploy without manual steps

🤖 Generated with Claude Code

Adds .github/workflows/deploy-hf.yml that mirrors the merged main branch
to https://huggingface.co/spaces/prathik10/pathways on every push to
main (and on manual workflow_dispatch). Force-pushes the full history
because HF Spaces start from an unrelated initial commit, and shallow
pushes are rejected. Includes a 10-minute /health poll after the push
so the workflow surfaces the deploy state but does not fail the build
if HF's rebuild runs long.

Requires one-time setup: HF access token with write scope, stored as
the HF_TOKEN repo secret. Space coords default to prathik10/pathways;
override with repo vars HF_SPACE_OWNER and HF_SPACE_NAME if needed.

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

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pathways Ready Ready Preview, Comment May 18, 2026 5:40am

@PrathikRavichandran
PrathikRavichandran merged commit 957de54 into main May 18, 2026
6 checks passed
@PrathikRavichandran
PrathikRavichandran deleted the ci/deploy-hf branch May 18, 2026 05:43
PrathikRavichandran added a commit that referenced this pull request May 18, 2026
docs: sync narrative after PRs #1 + #2 + add pathways-docs-sync Skill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant