From 35f30fa5818ab6e37db6423fd7769bb4f2bc118b Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 31 Dec 2021 12:39:44 +0000 Subject: [PATCH] Improve the tidy up step of the deployment --- .github/workflows/deploy.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 {};