Sync project files

This commit is contained in:
2026-08-12 19:38:47 -07:00
commit 6737ca6fb4
26 changed files with 2880 additions and 0 deletions

49
.github/old_workflows/deploy_hf.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Deploy to Hugging Face Space
on:
push:
branches: ["main"]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Configure Git auth
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
set -e
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions"
git config --global credential.helper store
echo "https://hf:${HF_TOKEN}@huggingface.co" > ~/.git-credentials
- name: Clone HF Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
set -e
rm -rf hf-space
git clone https://huggingface.co/spaces/MissouriMonster/x hf-space
- name: Sync files
run: |
rsync -av --exclude='.git' ./ hf-space/
- name: Commit changes
run: |
cd hf-space
git add .
git commit -m "deploy" || echo "no changes"
- name: Push to Hugging Face
run: |
cd hf-space
git push https://hf:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/MissouriMonster/x main

42
.github/workflows/deploy_vps.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Deploy to VPS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy via SSH
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.VPS_HOST }}
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
set -e
git config --global --add safe.directory /var/www/stream-api
cd /var/www/stream-api
mkdir -p /var/backups/stream-api
if [ -f data/api_keys.db ]; then
cp data/api_keys.db "/var/backups/stream-api/api_keys-$(date +%Y%m%d%H%M%S).db"
ls -t /var/backups/stream-api/api_keys-*.db | tail -n +31 | xargs -r rm --
fi
git fetch origin main
git reset --hard origin/main
git clean -fd -e data
npm install
mkdir -p data
pm2 restart stream-api || pm2 start server.js --name stream-api
pm2 save