diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index 5357cd3..85fd700 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -17,29 +17,6 @@ jobs: container: git.max-richter.dev/max/website:latest steps: - - name: setup test files - run: | - mkdir -p dist - echo "Hello, World!" > dist/index.html - - - 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\nuse_insecure_cipher = false\nmd5sum_command = none\nsha1sum_command = none" > ~/.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: | - rclone sync ./dist/ sftp-remote:${REMOTE_DIR} --sftp-key-file /tmp/id_rsa -v --ignore-existing --transfers 4 - env: - REMOTE_DIR: ${{ vars.REMOTE_DIR }} - - name: 🔄 Checkout code uses: actions/checkout@v3 @@ -79,3 +56,20 @@ jobs: # Install dependencies, build, and generate site output pnpm i && pnpm 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\nuse_insecure_cipher = false\nmd5sum_command = none\nsha1sum_command = none" > ~/.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: | + rclone sync --update -P ./dist/ sftp-remote:${REMOTE_DIR} --sftp-key-file /tmp/id_rsa -v --ignore-existing --transfers 4 + env: + REMOTE_DIR: ${{ vars.REMOTE_DIR }}