fix: ci
All checks were successful
Deploy to SFTP Server / build (push) Successful in 6m41s

This commit is contained in:
max_richter 2024-04-07 21:27:47 +02:00
parent 13f3312bb2
commit 6fb457c7ce
2 changed files with 13 additions and 10 deletions

View File

@ -16,25 +16,28 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: git.max-richter.dev/max/website:latest container: git.max-richter.dev/max/website:latest
steps: 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: | run: |
mkdir -p dist mkdir -p dist
echo "Hello, World!" > dist/index.html echo "Hello, World!" > dist/index.html
- name: 🚀 Deploy Changed Files via rsync - name: 🔑 Configure rclone
run: | 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: env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ vars.SSH_HOST }} SSH_HOST: ${{ vars.SSH_HOST }}
SSH_PORT: ${{ vars.SSH_PORT }} SSH_PORT: ${{ vars.SSH_PORT }}
SSH_USER: ${{ vars.SSH_USER }} 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 }} REMOTE_DIR: ${{ vars.REMOTE_DIR }}
- name: 🔄 Checkout code - name: 🔄 Checkout code

View File

@ -5,7 +5,7 @@ RUN apk add --no-cache \
git \ git \
git-lfs \ git-lfs \
tar \ tar \
rsync \ rclone \
openssh \ openssh \
bash bash