diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a7d59c0..7c9816b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,19 +22,36 @@ 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: Deploy to Server - uses: easingthemes/ssh-deploy@main + - name: Set to production + uses: appleboy/ssh-action@v1.0.3 with: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - ARGS: "-rlgoDzvc -i --delete" - SOURCE: "build/" - REMOTE_HOST: ${{ secrets.REMOTE_HOST }} - REMOTE_USER: ${{ secrets.REMOTE_USER }} - TARGET: ${{ secrets.TARGET }} - EXCLUDE: "/node_modules/" + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + script: | + mv /var/www/cyberswap/build/* /var/www/cyberswap/ + rm -rf /var/www/cyberswap/build