From 1b8f6d842f5b4eae2be57bc75e83dff8fd41f94f Mon Sep 17 00:00:00 2001 From: sanjar X <143950272+sanjar-x@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:00:45 +0500 Subject: [PATCH] Deploy to HOST --- .github/workflows/main.yml | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c9816b..db50341 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,36 +22,12 @@ jobs: run: | npm install echo "Dependencies installed successfully" + - name: npm run build run: | npm run build echo "Build completed successfully" - - name: Set to production directory - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - script: | - rm -rf /var/www/cyberswap/* - - - - name: Deploy to cyberswap - uses: appleboy/scp-action@v0.1.7 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - source: "./build/*" - target: "/var/www/cyberswap/" - continue-on-error: true - - name: Set to production - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - script: | - mv /var/www/cyberswap/build/* /var/www/cyberswap/ - rm -rf /var/www/cyberswap/build + - name: Deploy to Hosting + run: | + scp -r -o StrictHostKeyChecking=no -i ${{ secrets.SSH_PRIVATE_KEY }} ./build/* ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.TARGET }}