diff --git a/.gitea/workflows/service-packs.yaml b/.gitea/workflows/service-packs.yaml index 43bff8e..5061cbb 100644 --- a/.gitea/workflows/service-packs.yaml +++ b/.gitea/workflows/service-packs.yaml @@ -88,8 +88,16 @@ jobs: find packs -maxdepth 3 -type f 2>/dev/null || true test -n "$(find packs -type f -print -quit 2>/dev/null)" || { echo "packs is empty"; exit 1; } - - name: Install SCP in Docker container - run: apt-get install -y openssh-client + - name: Clean files before upload + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SDU_SSH_HOST }} + username: ${{ secrets.SDU_SSH_USERNAME }} + password: ${{ secrets.SDU_SSH_PASSWORD }} + port: 22 + script: | + mkdir -p "${{ secrets.SDU_SSH_PACKS }}" + find "${{ secrets.SDU_SSH_PACKS }}" -mindepth 1 -type f -delete - name: Upload to SSH using SCP uses: appleboy/scp-action@master @@ -101,4 +109,4 @@ jobs: source: "packs/*" target: "${{ secrets.SDU_SSH_PACKS }}" strip_components: 1 - rm: true \ No newline at end of file + rm: false \ No newline at end of file