DockerSpace / deploy_hf.sh
DennisChan0909's picture
chore: add deploy_hf.sh and gitignore .hf_token
42a743b
Raw
History Blame Contribute Delete
578 Bytes
#!/bin/bash
set -e
TOKEN_FILE="$(dirname "$0")/.hf_token"
if [ ! -f "$TOKEN_FILE" ]; then
echo "Error: $TOKEN_FILE not found"; exit 1
fi
TOKEN=$(cat "$TOKEN_FILE" | tr -d '[:space:]')
if [ -z "$TOKEN" ] || [ "$TOKEN" = "PASTE_YOUR_HF_TOKEN_HERE" ]; then
echo "Error: fill in your HF token in .hf_token first"; exit 1
fi
git remote set-url hf "https://dennischan0909:$TOKEN@huggingface.co/spaces/dennischan0909/dockerspace"
git push hf dev-main:main
git remote set-url hf "https://huggingface.co/spaces/dennischan0909/dockerspace"
echo "Done — HF Space rebuild triggered."