Skip to content

Commit

Permalink
Merge pull request #1 from naskio/improve-docs
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
naskio authored Jun 10, 2024
2 parents dc8961b + e6e1878 commit 7e8df7e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/check_file_size.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
####################################
# This workflow will check the file size does not exceed 10MB
# secrets:
# - GITHUB_TOKEN: GitHub API token with some extra permissions
# (octokit.rest.issues.[addLabels|listLabelsOnIssue|removeLabel|getLabel|createLabel|createComment],
# octokit.rest.pulls.listFiles, octokit.rest.git.getBlob, core.setFailed: set PR status to failed)
####################################

name: Check file size

on:
Expand All @@ -12,11 +20,13 @@ permissions: # Sets permissions of the GITHUB_TOKEN to allow lfs warning to work
pull-requests: write

jobs:
sync-to-hub:
check_file_size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check large files
uses: ppremk/lfs-warning@v3.2
with:
token: ${{ secrets.GITHUB_TOKEN }} # required with some permissions
filesizelimit: 10MB # this is 10MB so we can sync to HF Spaces
filesizelimit: 10MB # < 10MB so we can sync to HF Spaces
15 changes: 8 additions & 7 deletions .github/workflows/sync_to_hf.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
##### Sync to Hugging Face Hub #####
####################################
# This workflow will sync the repository to a Hugging Face Space
# secrets:
# - HF_TOKEN: Hugging Face API token
# - HF_TOKEN: Hugging Face access token
####################################

name: Sync to Hugging Face Hub
name: Sync to Hugging Face
on:
push:
branches: [ main ]

workflow_dispatch: # to run this workflow manually from the Actions tab

jobs:
sync-to-hub:
sync_to_hf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -24,7 +25,7 @@ jobs:
with:
python-version: '3.9'

- name: Setup Poetry
- name: Setup Poetry 1.8
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.8'
Expand All @@ -41,9 +42,9 @@ jobs:
git add requirements.txt packages.txt
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -m "auto-setup HF Space (Gradio): requirements.txt, packages.txt"
git commit -m "auto-setup HF Gradio Space: requirements.txt, packages.txt"
- name: Push to Hugging Face
- name: Force push to Hugging Face
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: git push https://naskio:$HF_TOKEN@huggingface.co/spaces/naskio/mergeui main --force

0 comments on commit 7e8df7e

Please sign in to comment.