ci: update ci workflow for gitea
Deploy Site / deploy (push) Canceled after 0s

This commit is contained in:
2026-07-26 11:01:11 +05:00
parent ec01e1ce56
commit 36e2cd5078
2 changed files with 34 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
name: Deploy Site
on:
push:
branches: [main]
workflow_dispatch:
env:
PROJECT_NAME: "shooting-word"
jobs:
deploy:
runs-on: host
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy to VPS
run: |
if [ -z "${{ env.PROJECT_NAME }}" ]; then
echo "❌ Error: Variable PROJECT_NAME MUST BE set!"
exit 1
fi
TARGET_DIR="/var/www/sites/${{ env.PROJECT_NAME }}"
mkdir -p "$TARGET_DIR"
rm -rf "${TARGET_DIR:?}"/*
tar --exclude='./.git*' \
--exclude='./.gitea*' \
--exclude='./*.md' \
--exclude='./LICENSE' \
-cf - . | tar -xf - -C "$TARGET_DIR"