Download .github/workflows/sync_to_hf.yml from PrivEcho/encrypted_sentiment_analysis: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/PrivEcho/encrypted_sentiment_analysis/resolve/main/.github/workflows/sync_to_hf.yml
- Command line
-
hf download hf://spaces/PrivEcho/encrypted_sentiment_analysis/.github/workflows/sync_to_hf.yml
-
curl -L -o sync_to_hf.yml https://huggingface.co/spaces/PrivEcho/encrypted_sentiment_analysis/resolve/main/.github/workflows/sync_to_hf.yml
1.05 kB
| name: Sync to Hugging Face | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' # Specify your Python version | |
| - name: Install dependencies | |
| run: | | |
| pip install huggingface_hub | |
| - name: Sync to Hugging Face | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| # Configure git | |
| git config --global user.email "myronzhangweb3@gmail.com" | |
| git config --global user.name "Myron Zhang" | |
| # Clone the Hugging Face repository | |
| git clone https://myronzhangweb3:$HF_TOKEN@huggingface.co/spaces/PrivEcho/encrypted_sentiment_analysis hf_repo | |
| cd hf_repo | |
| # Copy files from the GitHub repository | |
| rsync -av --exclude='.git' ../ . | |
| # Commit and push changes to Hugging Face | |
| git add . | |
| git commit -m "Sync from GitHub" | |
| git push |