Felipe Parodi
Add GH Action to sync to HuggingFace
c5084cf
name: Sync to HuggingFace
on:
push:
branches: [main]
paths: [README.md]
workflow_dispatch:
concurrency:
group: huggingface-sync
cancel-in-progress: true
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to HuggingFace
run: |
git push --force https://fparodi:${{ secrets.PARODI_HF_TOKEN }}@huggingface.co/datasets/fparodi/awesome-computational-primatology main
- name: Create issue on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'HuggingFace Sync Failed - ' + new Date().toISOString().slice(0, 10),
body: 'The automatic sync to HuggingFace failed.\n\nSee: ' + context.serverUrl + '/' + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + context.runId,
labels: ['maintenance']
});