Download docs/DEPLOY.md from christopher-dev/recruiter-assistant: direct link, hf CLI and curl.
- Browser
- Download file 4.34 kB
-
https://huggingface.co/spaces/christopher-dev/recruiter-assistant/resolve/main/docs/DEPLOY.md
- Command line
-
hf download hf://spaces/christopher-dev/recruiter-assistant/docs/DEPLOY.md
-
curl -L -o DEPLOY.md https://huggingface.co/spaces/christopher-dev/recruiter-assistant/resolve/main/docs/DEPLOY.md
Deploy
The backend runs as a Hugging Face Docker Space, the chat page runs on GitHub Pages. Do the steps in this order: the Space URL goes into the page config, and the page origin goes into the Space settings.
Replace <hf-user> with your Hugging Face user name. The Space URL is https://<hf-user>-recruiter-assistant.hf.space (lowercase; dots and underscores in the name become dashes). The page URL is https://mooncak397.github.io/recruiter-assistant/.
1. Resend (contact form email)
- Create an account at https://resend.com.
- Go to API Keys, create a key with "Sending access". Copy it for step 3.
- Without a verified domain, Resend only sends from
onboarding@resend.devand only to the email address of your Resend account. Use that address asCONTACT_TO. With your own domain verified, you can also setCONTACT_FROM, for exampleRecruiter assistant <bot@your-domain>.
2. Cloudflare Turnstile (bot check)
- Create a free Cloudflare account, open Turnstile, click Add widget.
- Hostnames:
mooncak397.github.io(addlocalhosttoo if you want to test locally). Mode: Managed. - Copy the site key into
web/config.jsasTURNSTILE_SITE_KEY. It is public. - Keep the secret key for step 3. It is a secret: never put it in the repo.
3. Hugging Face Space (backend)
- Create an account at https://huggingface.co and go to New Space.
- Name:
recruiter-assistant. SDK: Docker, template Blank. Hardware: CPU basic (free). Visibility: public is fine, the code is public on GitHub anyway. - In the Space, open Settings β Variables and secrets. Add these as secrets:
ANTHROPIC_API_KEY(Claude), orGEMINI_API_KEY(Gemini free tier). One is enough.SESSION_HMAC_KEY: a random value. Make one withpython3 -c "import secrets; print(secrets.token_hex(32))".RESEND_API_KEY: from step 1.TURNSTILE_SECRET: from step 2.CONTACT_TO: the email address that gets the contact messages (see step 1.3).
- Add these as variables (not secret):
- Claude:
PROVIDER_APP=anthropicandMODEL_APP=claude-haiku-5-5. - Gemini:
MODEL_APP=gemini-3.5-flash-lite(the provider default is Gemini, so noPROVIDER_APP). ALLOWED_ORIGIN=https://mooncak397.github.io(the origin only: no path, no trailing slash).
- Claude:
- Create a Hugging Face access token with write permission: Settings β Access Tokens.
- Push the repo to the Space, from the repo folder:
Git asks for a user name (your HF user name) and a password (the write token from step 5).git remote add space https://huggingface.co/spaces/<hf-user>/recruiter-assistant git push --force space main--forceis only for this first push: it replaces the starter README that the new Space has. Later pushes are a normalgit push space main. The front matter at the top ofREADME.mdtells the Space to build theDockerfileon port 7860. - Wait for the build (Space page, Logs tab, a few minutes). Then check:
The reply iscurl https://<hf-user>-recruiter-assistant.hf.space/health{"status":"ok","prompt_version":"..."}.
A free Space sleeps after 48 hours without traffic. The page calls /health on load to wake it; the first answer then takes about a minute.
4. GitHub Pages (chat page)
- In
web/config.js, setAPI_BASEtohttps://<hf-user>-recruiter-assistant.hf.space(no trailing slash). TheTURNSTILE_SITE_KEYis set from step 2.3. - On GitHub, open the repo Settings β Pages. Under Build and deployment β Source, choose GitHub Actions.
- Commit and push the
web/config.jschange tomain. A push that changesweb/starts the Pages workflow. You can also start it by hand: Actions β Pages β Run workflow. - Open
https://mooncak397.github.io/recruiter-assistant/. Ask one question and send one test message with the contact form.
Optional: evals in CI
The CI workflow runs the tests on every push. Its evals-fast job runs only by hand (Actions β CI β Run workflow) and needs a repository secret: Settings β Secrets and variables β Actions β New repository secret, name ANTHROPIC_API_KEY or GEMINI_API_KEY. Each run calls the model for every golden case, so it costs money with Claude (a few cents).