This commit is contained in:
parent
13f3312bb2
commit
6fb457c7ce
21
.github/workflows/default.yaml
vendored
21
.github/workflows/default.yaml
vendored
@ -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
|
||||||
|
@ -5,7 +5,7 @@ RUN apk add --no-cache \
|
|||||||
git \
|
git \
|
||||||
git-lfs \
|
git-lfs \
|
||||||
tar \
|
tar \
|
||||||
rsync \
|
rclone \
|
||||||
openssh \
|
openssh \
|
||||||
bash
|
bash
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user