diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7f339c5..2f907c1 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: build run: | ls -la @@ -27,19 +27,17 @@ jobs: run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts - name: check if remote file exists - uses: fifsky/ssh-action@master - id: version-exists + uses: appleboy/ssh-action@v1.0.3 with: - command: | + host: ${{ secrets.SSH_HOST }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | if [ -f /var/www/html/${{ steps.package-version.outputs.current-version}} ]; then exists=yes else exists=no fi echo "EXISTS=$exists" >> "$GITHUB_OUTPUT" - host: ${{ secrets.SSH_HOST }} - user: root - key: ${{ secrets.SSH_PRIVATE_KEY }} - name: fail if version exists if: ${{ steps.version-exists.outputs.EXISTS == 'yes' }}