| name: Sync to Hugging Face hub | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| sync-to-hub: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Push to hub | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: git push --force https://MLOps26:$HF_TOKEN@huggingface.co/spaces/MLOps26/FGDemo HEAD:main | |
| - name: Send email notification | |
| if: always() | |
| uses: dawidd6/action-send-mail@v3 | |
| with: | |
| server_address: smtp.gmail.com | |
| server_port: 465 | |
| username: ${{ secrets.EMAIL_USERNAME }} | |
| password: ${{ secrets.EMAIL_PASSWORD }} | |
| subject: "MLOps: Hugging Face Sync ${{ job.status }}" | |
| to: cejason@wpi.edu, kagupta@wpi.edu, afrenk@wpi.edu | |
| from: ${{ secrets.EMAIL_USERNAME }} | |
| body: | | |
| Status: ${{ job.status }} | |
| Repository: ${{ github.repository }} | |
| Branch: ${{ github.ref_name }} | |
| Commit: ${{ github.sha }} | |
| Triggered by: ${{ github.actor }} | |