From 6fb457c7cefbd3e012b56eb8674b71ce19e48c55 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Sun, 7 Apr 2024 21:27:47 +0200 Subject: [PATCH] fix: ci --- .github/workflows/default.yaml | 21 ++++++++++++--------- Dockerfile | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index 5c215cd..5357cd3 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -16,25 +16,28 @@ jobs: runs-on: ubuntu-latest container: git.max-richter.dev/max/website:latest steps: - - name: 🔑 Set up SSH Key - run: | - echo "$SSH_PRIVATE_KEY" > /tmp/id_rsa - chmod 600 /tmp/id_rsa - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Create Test Files + - name: setup test files run: | mkdir -p dist echo "Hello, World!" > dist/index.html - - name: 🚀 Deploy Changed Files via rsync + - name: 🔑 Configure rclone run: | - rsync -avz -e "ssh -o StrictHostKeyChecking=no -i /tmp/id_rsa -p ${SSH_PORT}" ./dist/ ${SSH_USER}@${SSH_HOST}:${REMOTE_DIR} + 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 diff --git a/Dockerfile b/Dockerfile index 21ac9b3..7ba267b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apk add --no-cache \ git \ git-lfs \ tar \ - rsync \ + rclone \ openssh \ bash