diff --git a/.github/workflow/deploy.yml b/.github/workflow/deploy.yml index 6f10a9b..aaf7b35 100644 --- a/.github/workflow/deploy.yml +++ b/.github/workflow/deploy.yml @@ -1,4 +1,5 @@ -name: Deploy to VPS +name: Deploy Website + on: push: branches: @@ -8,14 +9,15 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up SSH - uses: webfactory/ssh-agent@v0.5.3 - with: - ssh-private-key: ${{ secrets.VPS_SSH_PRIVATE_KEY }} + - name: Checkout code + uses: actions/checkout@v2 - - name: Deploy to VPS - run: | - ssh -o StrictHostKeyChecking=no root@104.248.39.231 'cd /var/www/senic.site && git pull' + - name: Deploy to Server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.SSH_KEY }} + source: "./" + target: "/var/www/senic.site" + rm: true \ No newline at end of file