Spaces:
Runtime error
Runtime error
Commit
·
4159b48
1
Parent(s):
58de479
added actions
Browse files- .github/workflows/actions_onpull.yaml +16 -0
- .github/workflows/actions_onpush.yaml +20 -0
- README.md +21 -1
.github/workflows/actions_onpull.yaml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Check file size
|
2 |
+
on: # or directly `on: [push]` to run the action on every push on any branch
|
3 |
+
pull_request:
|
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 |
+
- name: Check large files
|
14 |
+
uses: ActionsDesk/lfs-warning@v2.0
|
15 |
+
with:
|
16 |
+
filesizelimit: 10485760 # this is 10MB so we can sync to HF Spaces
|
.github/workflows/actions_onpush.yaml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
- name: Push to hub
|
18 |
+
env:
|
19 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
20 |
+
run: git push https://paisleypark3121:$HF_TOKEN@huggingface.co/spaces/StefanoDUrso/Chainlit-docker main
|
README.md
CHANGED
@@ -73,4 +73,24 @@ git pull origin
|
|
73 |
|
74 |
Once pulled, the target: https://huggingface.co/spaces/MY_HUGGINGFACE_NAME/Chainlit-docker?logs=container will starting loading the application (we will see the logs) and in the end we will see it running at: https://huggingface.co/spaces/MY_HUGGINGFACE_NAME/Chainlit-docker
|
75 |
|
76 |
-
Let's now push the code into the Github repo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
Once pulled, the target: https://huggingface.co/spaces/MY_HUGGINGFACE_NAME/Chainlit-docker?logs=container will starting loading the application (we will see the logs) and in the end we will see it running at: https://huggingface.co/spaces/MY_HUGGINGFACE_NAME/Chainlit-docker
|
75 |
|
76 |
+
Let's now push the code into the Github repo: let's create the Github repo and let's ADD this new repo to the config:
|
77 |
+
git remote add github_repo https://github.com/MY_GITHUB_NAME/Chainlit-docker.git
|
78 |
+
in order to push on this we need to specify the github repo, so performing:
|
79 |
+
git push github_repo
|
80 |
+
|
81 |
+
|
82 |
+
You can keep your app in sync with your GitHub repository with Github Actions
|
83 |
+
|
84 |
+
First, you should set up your GitHub repository and Spaces app together. Add your Spaces app as an additional remote to your existing Git repository.
|
85 |
+
git remote add space https://huggingface.co/spaces/MY_HUGGINGFACE_NAME/Chainlit-docker
|
86 |
+
|
87 |
+
Then force push to sync everything for the first time:
|
88 |
+
git push --force space main
|
89 |
+
|
90 |
+
Create a Github secret with your HF_TOKEN.
|
91 |
+
Github secret tutorial: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-encrypted-secrets-for-an-environment
|
92 |
+
repository -> settings -> secrets and variables -> actions -> new repo secret
|
93 |
+
|
94 |
+
create the HF_TOKEN with the value of the token configured in HuggingFace
|
95 |
+
|
96 |
+
In your repository, create the .github/workflows/ directory to store your workflow files.
|