Maria Tsilimos
commited on
Create main.yml
Browse files- .github/workflows/main.yml +42 -0
.github/workflows/main.yml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Sync to Hugging Face hub
|
2 |
+
on:
|
3 |
+
push:
|
4 |
+
branches: [main]
|
5 |
+
|
6 |
+
# to run this workflow manually from the Actions tab
|
7 |
+
workflow_dispatch:
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
sync-to-hub:
|
11 |
+
runs-on: ubuntu-latest
|
12 |
+
steps:
|
13 |
+
- uses: actions/checkout@v3
|
14 |
+
with:
|
15 |
+
fetch-depth: 0
|
16 |
+
lfs: true
|
17 |
+
|
18 |
+
- name: Push to hub
|
19 |
+
env:
|
20 |
+
# Hugging Face token for authentication with the Hub
|
21 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
22 |
+
# Fernet key for encryption/decryption (if needed by your action, e.g., for tests)
|
23 |
+
FERNET_KEY: ${{ secrets.FERNET_KEY }}
|
24 |
+
# Comet ML credentials (if your action performs Comet logging)
|
25 |
+
COMET_API_KEY: ${{ secrets.COMET_API_KEY }}
|
26 |
+
COMET_WORKSPACE: ${{ secrets.COMET_WORKSPACE }}
|
27 |
+
COMET_PROJECT_NAME: ${{ secrets.COMET_PROJECT_NAME }}
|
28 |
+
run: |
|
29 |
+
# This command uses the HF_TOKEN to push to Hugging Face Spaces.
|
30 |
+
# The other secrets (FERNET_KEY, COMET_*) are now available as
|
31 |
+
# environment variables for any subsequent Python scripts or commands
|
32 |
+
# that the 'run' block might execute.
|
33 |
+
#
|
34 |
+
# For example, if you had a Python script called 'test_encryption.py'
|
35 |
+
# that uses FERNET_KEY, you could run it here:
|
36 |
+
# python test_encryption.py
|
37 |
+
#
|
38 |
+
# Or if you were doing Comet ML logging directly from the action:
|
39 |
+
# python train_model.py
|
40 |
+
|
41 |
+
# Your original push command:
|
42 |
+
git push --force https://nlpblogs:[email protected]/spaces/AIEcosystem/Multilingual-PDF-DOCX-Entity-Finder main
|