Spaces:
Running
Running
Commit
·
bbb1364
1
Parent(s):
900e747
moved workflows to external repo
Browse files
.github/workflows/keep_LibreChat_and_Meilisearch_awake.yml
DELETED
|
@@ -1,48 +0,0 @@
|
|
| 1 |
-
name: Keep LibreChat and Meilisearch awake
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
schedule:
|
| 5 |
-
# Führt den Workflow zu jeder vollen Stunde zwischen 4-8 Uhr und 16-20 Uhr UTC aus
|
| 6 |
-
- cron: '*/11 8-9,16-17 * * *'
|
| 7 |
-
|
| 8 |
-
workflow_dispatch:
|
| 9 |
-
# Erlaubt das manuelle Auslösen des Workflows
|
| 10 |
-
|
| 11 |
-
jobs:
|
| 12 |
-
wakeup-and-sync:
|
| 13 |
-
runs-on: ubuntu-latest
|
| 14 |
-
steps:
|
| 15 |
-
# Schritt 0: Pseudo-random check
|
| 16 |
-
- name: Decide whether to run this time
|
| 17 |
-
id: decide # Give this step an ID to reference its output
|
| 18 |
-
run: |
|
| 19 |
-
# Use the bash $RANDOM variable to get a number between 0 and 32767.
|
| 20 |
-
# Use the modulo operator (%) to check if it's divisible by a number.
|
| 21 |
-
# A smaller modulo number increases the probability of the job running.
|
| 22 |
-
# Here, `RANDOM % 5 == 0` creates a 1 in 5 chance (20%) of proceeding.
|
| 23 |
-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
| 24 |
-
echo "Manual trigger detected. Forcing run."
|
| 25 |
-
echo "should_run=true" >> $GITHUB_OUTPUT
|
| 26 |
-
else
|
| 27 |
-
if (( RANDOM % 5 == 0 )); then
|
| 28 |
-
echo "Proceeding with the curl request."
|
| 29 |
-
echo "should_run=true" >> $GITHUB_OUTPUT
|
| 30 |
-
else
|
| 31 |
-
echo "Canceled this run to ensure randomness. Will try again on the next schedule."
|
| 32 |
-
echo "should_run=false" >> $GITHUB_OUTPUT
|
| 33 |
-
fi
|
| 34 |
-
fi
|
| 35 |
-
|
| 36 |
-
# Schritt 1: Hält den LibreChat Space wach
|
| 37 |
-
- name: Keep LibreChat Space awake
|
| 38 |
-
if: steps.decide.outputs.should_run == 'true'
|
| 39 |
-
run: |
|
| 40 |
-
curl --fail -H "Authorization: Bearer ${{ secrets.HF_TOKEN }}" "https://mer0mingian-mer0LibreChat.hf.space/"
|
| 41 |
-
echo "LibreChat keep-awake call sent."
|
| 42 |
-
|
| 43 |
-
# Schritt 2: Hält den Meilisearch Space wach
|
| 44 |
-
- name: Keep Meilisearch Space awake
|
| 45 |
-
if: steps.decide.outputs.should_run == 'true'
|
| 46 |
-
run: |
|
| 47 |
-
curl --fail -H "Authorization: Bearer ${{ secrets.HF_TOKEN }}" "https://mer0mingian-meilisearch.hf.space"
|
| 48 |
-
echo "Meilisearch keep-awake call sent."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/sync_meilisearch_index.yml
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
name: Reset Meilisearch Index
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
|
| 5 |
-
|
| 6 |
-
jobs:
|
| 7 |
-
reset-index:
|
| 8 |
-
runs-on: ubuntu-latest
|
| 9 |
-
steps:
|
| 10 |
-
# To remove the entire index: remove "/documents" from the curl statement below
|
| 11 |
-
- name: Reset Meilisearch Index by deleting all documents
|
| 12 |
-
run: |
|
| 13 |
-
curl -X DELETE '${{ secrets.MEILISEARCH_HOST }}/indexes/convos/documents' \
|
| 14 |
-
-H 'Authorization: Bearer ${{ secrets.MEILI_MASTER_KEY }}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|