Maria Tsilimos
Create main.yml
652c80c unverified
name: Sync to Hugging Face hub
on:
push:
branches: [main]
# to run this workflow manually from the Actions tab
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:
# Hugging Face token for authentication with the Hub
HF_TOKEN: ${{ secrets.HF_TOKEN }}
# Fernet key for encryption/decryption (if needed by your action, e.g., for tests)
FERNET_KEY: ${{ secrets.FERNET_KEY }}
# Comet ML credentials (if your action performs Comet logging)
COMET_API_KEY: ${{ secrets.COMET_API_KEY }}
COMET_WORKSPACE: ${{ secrets.COMET_WORKSPACE }}
COMET_PROJECT_NAME: ${{ secrets.COMET_PROJECT_NAME }}
run: |
# This command uses the HF_TOKEN to push to Hugging Face Spaces.
# The other secrets (FERNET_KEY, COMET_*) are now available as
# environment variables for any subsequent Python scripts or commands
# that the 'run' block might execute.
#
# For example, if you had a Python script called 'test_encryption.py'
# that uses FERNET_KEY, you could run it here:
# python test_encryption.py
#
# Or if you were doing Comet ML logging directly from the action:
# python train_model.py
# Your original push command:
git push --force https://nlpblogs:$HF_TOKEN@huggingface.co/spaces/AIEcosystem/Scandinavian-JSON-Entity-Finder main