Feature/huggingface space continuous deployment#7
Feature/huggingface space continuous deployment#7whats2000 wants to merge 4 commits intoai-twinkle:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds Hugging Face Spaces deployment infrastructure with continuous deployment from the main branch. It includes a Docker-based setup configured for HF Spaces requirements (port 7860) and a GitHub Actions workflow that automatically syncs the repository to the Space on every push to main.
Changes:
- Added Hugging Face Spaces YAML metadata to README.md for Space configuration
- Created Dockerfile with Streamlit server configured for port 7860 (HF Spaces requirement)
- Added GitHub Actions workflow for automatic deployment to HF Space via git push
- Added .dockerignore to optimize Docker image build
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Added HF Spaces YAML front-matter with SDK configuration and app metadata |
| Dockerfile | Configured Python 3.13 environment with Streamlit running on port 7860 |
| .github/workflows/huggingface.yml | Automated deployment workflow that syncs main branch to HF Space repository |
| .dockerignore | Excluded development files and directories from Docker image |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| COPY . . | ||
|
|
||
| RUN pip3 install -r requirements.txt | ||
|
|
There was a problem hiding this comment.
The order of COPY operations is inefficient for Docker layer caching. Currently, requirements.txt is copied first but then the entire directory (including requirements.txt again) is copied immediately after. This negates the benefit of separate layer caching. Consider restructuring to copy requirements.txt, run pip install, and then copy the rest of the application files. This way, the dependencies layer will only rebuild when requirements.txt changes, not when any application file changes.
| COPY . . | |
| RUN pip3 install -r requirements.txt | |
| RUN pip3 install -r requirements.txt | |
| COPY . . |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
✨ Add Hugging Face Spaces continuous deployment (Docker)
This PR adds a Hugging Face Spaces (Docker) deployment setup for
eval-analyzer, plus a GitHub Actions workflow that auto-syncsmainto the Space repo using anHF_TOKENsecret.What changed
Docker-based Space runtime
Dockerfilethat runs Streamlit (app.py) on port 7860 (required by HF Spaces), with a healthcheck..dockerignoreto keep the image small / avoid copying local env + git metadata.Continuous deployment workflow
.github/workflows/huggingface.ymlto force-pushmainto the Space on every push tomain(also supports manual dispatch).https://huggingface.co/spaces/twinkle-ai/tw-eval-analyzerSpace metadata
README.md(title/emoji/colors +sdk: docker,app_file: app.py).How deployment works
On every push to
main, GitHub Actions runs a job that:HF_TOKENSetup instructions (Hugging Face Space +
HF_TOKEN)1) Create the Space under the org
twinkle-aitw-eval-analyzer(must match the workflow push target)2) Create a Hugging Face token
3) Add
HF_TOKENto GitHub repo secretsIn GitHub repo → Settings → Secrets and variables → Actions → New repository secret:
HF_TOKENThe workflow uses
secrets.HF_TOKENas an env var when pushing to the Space.Verification / expected result
twinkle-ai/tw-eval-analyzerexistsHF_TOKENsecret to GitHubmainNotes / caveats
git push --forceto syncmainto the Space repo. This is intentional for “mirror main to Space” behavior, but it will overwrite the Space’s git history.