From c8b89803aa92be5535ab4c6c498db43390fcad68 Mon Sep 17 00:00:00 2001 From: Remco <1+remco@noreply.gitlabi@epicnabbo.nl> Date: Sat, 11 Jul 2026 21:06:50 +0200 Subject: [PATCH] Add .gitea/workflows/deploy.yml --- .gitea/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/ .gitea/workflows/deploy.yml b/ .gitea/workflows/deploy.yml new file mode 100644 index 00000000..59e1e93b --- /dev/null +++ b/ .gitea/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Remote Build and Deploy + +on: + push: + branches: + +main, + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + +name: Checkout Repository + uses: actions/checkout@v4, + + +name: Execute Remote SSH Commands to Build and Deploy + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + port: ${{ secrets.SSH_PORT }} + script: | + echo "--- Starting Deployment Pipeline ---" + # 1. Navigate to your project folder on the VPS + cd /var/www/my-project + # 2. Sync the VPS local code with your Gitea repository + git fetch --all + git reset --hard origin/main + # 3. Build & Restart Commands (Uncomment or adapt to your stack)# Node.js example:# npm install --production# npm run build# pm2 restart my-app + # Docker example:# docker compose down# docker compose up -d --build + echo "--- Deployment Completed Successfully ---" \ No newline at end of file