diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5a6f727f..e659fcbe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -138,6 +138,5 @@ jobs: username: ${{ secrets.DEPLOYMENT_USER }} key: ${{ secrets.DEPLOYMENT_KEY }} script: | - cd ${{ env.releasesDir }} - ls -dt ${{ env.releasesDir }}/* | tail -n +4 | xargs -d "\n" sudo chown -R ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_USER }} ./bootstrap/cache; - ls -dt ${{ env.releasesDir }}/* | tail -n +4 | xargs -d "\n" rm -rf; + fd '.+' ${{ env.releasesDir }} -d 1 | head -n -3 | xargs -d "\n" -I'{}' sudo chown -R ${{ secrets.DEPLOYMENT_USER }}:${{ secrets.DEPLOYMENT_USER }} {}/bootstrap/cache; + fd '.+' ${{ env.releasesDir }} -d 1 | head -n -3 | xargs -d "\n" -I'{}' rm -rf {};