name: Deploy to Hugging Face Spaces on: push: branches: - main workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Push to Hugging Face Spaces env: HF_TOKEN: ${{ secrets.HF_TOKEN }} HF_SPACE_URL: "https://huggingface.co/spaces/yezdata/emcoder-api-ui" run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" AUTHENTICATED_URL=$(echo "$HF_SPACE_URL" | sed "s|https://|https://yezdata:$HF_TOKEN@|") git remote add hf "$AUTHENTICATED_URL" echo "Pushing code to Hugging Face Spaces..." git push --force hf main:main