name: Restart Hugging Face Space on: workflow_dispatch: inputs: monitor_id: description: 'input_monitor_id' required: true jobs: sync-to-hub: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set environment variables run: | if [ "${{ github.event.inputs.monitor_id }}" = "21" ]; then export HF_TOKEN="${{ secrets.HF_1 }}" export USERNAME="GordonChan365" export SPACE="hf-llm-api" elif [ "${{ github.event.inputs.monitor_id }}" = "2" ]; then export HF_TOKEN="${{ secrets.HF_2 }}" export USERNAME="gordonchan" export SPACE="another-space" else echo "Invalid monitor_id" exit 1 fi - name: Update README title run: | sed -i "s/title: .*/title: $SPACE/" README.md - name: Restart Space run: | git push -f https://$USERNAME:$HF_TOKEN@huggingface.co/spaces/$USERNAME/$SPACE main:main