Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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!"