From e24db238886ce1854ea803e81194cd95eded11d7 Mon Sep 17 00:00:00 2001 From: Claw AI Date: Thu, 14 May 2026 08:58:55 +0000 Subject: [PATCH] ci: add deploy pipeline for feature branches to test environment --- .gitea/workflows/deploy-test.yml | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .gitea/workflows/deploy-test.yml diff --git a/.gitea/workflows/deploy-test.yml b/.gitea/workflows/deploy-test.yml new file mode 100644 index 0000000..a1d3338 --- /dev/null +++ b/.gitea/workflows/deploy-test.yml @@ -0,0 +1,62 @@ +name: Deploy Feature Branch to Test + +on: + push: + branches: + - "feature/**" + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Show branch info + run: | + echo "=== Deploying branch: ${{ gitea.ref_name }} ===" + echo "=== Commit: ${{ gitea.sha }} ===" + echo "=== By: ${{ gitea.actor }} ===" + date + + - name: Deploy to test environment + run: | + echo "Syncing files to /var/www/test/html/ ..." + rsync -av --delete \ + --exclude='.git' \ + --exclude='.gitea' \ + --exclude='.husky' \ + --exclude='.prettierrc' \ + --exclude='.prettierignore' \ + --exclude='.stylelintrc.json' \ + --exclude='.htmlhintrc' \ + --exclude='.gitignore' \ + --exclude='.dockerignore' \ + --exclude='Dockerfile' \ + --exclude='nginx.conf' \ + --exclude='eslint.config.js' \ + --exclude='package.json' \ + --exclude='docker-preview.png' \ + --exclude='page-preview.png' \ + --exclude='screenshot-landingpage*' \ + --exclude='AGENTS.md' \ + --exclude='README.md' \ + ./ /var/www/test/html/ + echo "✅ Deployment complete!" + + - name: Set permissions + run: | + chown -R www-data:www-data /var/www/test/html/ + chmod -R 755 /var/www/test/html/ + echo "✅ Permissions set" + + - name: Deployment summary + run: | + echo "==========================================" + echo " 🚀 Deployment Summary" + echo "==========================================" + echo " Branch: ${{ gitea.ref_name }}" + echo " Commit: ${{ gitea.sha }}" + echo " Target: http://178.104.150.0/" + echo " Time: $(date)" + echo "=========================================="