From 3c4215be62ef57f9c5fbcac8ed7f6b5cf7a84d9d Mon Sep 17 00:00:00 2001 From: devlopersabbir Date: Wed, 2 Jul 2025 21:28:09 +0600 Subject: [PATCH] =?UTF-8?q?[feat]=20created=20a=20deploy=20action=20to=20a?= =?UTF-8?q?utomate=20the=20deployment=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yaml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..8476f3b --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,39 @@ +name: Deployment VPS + +on: + push: + branches: ["main"] + +env: + VPS_HOST: ${{ secrets.VPS_HOST }} + VPS_SSH: ${{ secrets.VPS_SSH }} + VPS_USER: ${{ secrets.VPS_USER }} + VPS_PASSWORD: ${{ secrets.VPS_PASSWORD }} + +jobs: + deploy: + name: Deploy to VPS + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Deploy to VPS via SSH + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ env.VPS_HOST }} + username: ${{ env.VPS_USER }} + password: ${{ env.VPS_PASSWORD }} + key: ${{ env.VPS_SSH }} + script: | + # Navigate to the executeme directory on the VPS. + cd ~/workspace/executeme + + # Pull the latest code from the 'main' branch of the GitHub repository. + git pull + + # Execute your bash script. + bash ./script.sh + + echo "Deployment complete!"