ci: auto-deploy main to HF Space on merge - #2
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/workflows/deploy-hf.ymlto mirrormaintohuggingface.co/spaces/prathik10/pathwayson every merge (and on manualworkflow_dispatch). Eliminates the manualgit push huggingface mainstep./healthfor 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
gh secret set HF_TOKEN # paste the token when promptedFirst-run plan
After merging this PR, trigger the workflow manually once to validate:
That run will push every merged commit since the last manual HF push (which includes the map-view PR). Subsequent merges to
mainthen auto-deploy.Design choices worth flagging
::warning::and exits 0; you'll see it in the Actions tab.Test plan
gh secret set HF_TOKENoncegh workflow run deploy-hf.yml --ref main-> first run pushes the backlog (map-view PR + this workflow itself)mainshould auto-deploy without manual steps🤖 Generated with Claude Code