From d45a9503859721876758fa754434a5212cf835d4 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Wed, 24 Apr 2024 03:16:24 +0200 Subject: [PATCH] feat: add uploading to ci --- .github/workflows/deploy.yaml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 1ec10c4..ed7cabe 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -18,8 +18,21 @@ jobs: - name: build run: pnpm run build - - name: Upload Artifacts - uses: actions/upload-pages-artifact@v3 - with: - # this should match the `pages` option in your adapter-static options - path: 'app/build/' + - name: 🔑 Configure rclone + run: | + echo "$SSH_PRIVATE_KEY" > /tmp/id_rsa + chmod 600 /tmp/id_rsa + mkdir -p ~/.config/rclone + echo -e "[sftp-remote]\ntype = sftp\nhost = ${SSH_HOST}\nuser = ${SSH_USER}\nport = ${SSH_PORT}\nkey_file = /tmp/id_rsa" > ~/.config/rclone/rclone.conf + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SSH_HOST: ${{ vars.SSH_HOST }} + SSH_PORT: ${{ vars.SSH_PORT }} + SSH_USER: ${{ vars.SSH_USER }} + + - name: 🚀 Deploy Changed Files via rclone + run: | + echo "Uploading the rest" + rclone sync --update -v --progress --exclude _astro/** --stats 2s --stats-one-line ./app/build/ sftp-remote:${REMOTE_DIR} --transfers 4 + env: + REMOTE_DIR: ${{ vars.REMOTE_DIR }}