Spaces:
Running
Running
| name: Sync to Hugging Face Spaces | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| workflow_run: | |
| workflows: ["Scheduled Daily Gold Scraper"] | |
| types: | |
| - completed | |
| # Allow manual trigger from the GitHub Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Push to Hugging Face Space | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| # Configure Git credentials | |
| git config --global user.email "deploy-action@github.com" | |
| git config --global user.name "GitHub Deploy Action" | |
| # Add the Hugging Face Space git remote as 'hf' | |
| # Sync to your Hugging Face Space repository | |
| git remote add hf https://dwssp:$HF_TOKEN@huggingface.co/spaces/dwssp/Ceylon-Gold-Rate | |
| # Force push the main branch to the Hugging Face Space | |
| git push --force hf HEAD:main | |