ci: deploy with tar over ssh (no rsync required)
Some checks failed
deploy / build-and-deploy (push) Has been cancelled
Some checks failed
deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -51,7 +51,9 @@ jobs:
|
|||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
ssh-keyscan -p "${{ secrets.DEPLOY_SSH_PORT }}" -H "${{ secrets.DEPLOY_SSH_HOST }}" >> ~/.ssh/known_hosts
|
ssh-keyscan -p "${{ secrets.DEPLOY_SSH_PORT }}" -H "${{ secrets.DEPLOY_SSH_HOST }}" >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Deploy via rsync
|
- name: Deploy via tar over SSH
|
||||||
if: ${{ secrets.DEPLOY_SSH_KEY != '' }}
|
if: ${{ secrets.DEPLOY_SSH_KEY != '' }}
|
||||||
run: |
|
run: |
|
||||||
rsync -az --delete -e "ssh -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_SSH_PORT }}" dist/ "${{ secrets.DEPLOY_SSH_USER }}@${{ secrets.DEPLOY_SSH_HOST }}:${{ secrets.DEPLOY_PATH }}/"
|
tar -C dist -czf - . | \
|
||||||
|
ssh -i ~/.ssh/deploy_key -p "${{ secrets.DEPLOY_SSH_PORT }}" "${{ secrets.DEPLOY_SSH_USER }}@${{ secrets.DEPLOY_SSH_HOST }}" \
|
||||||
|
"bash -lc 'set -euo pipefail; tmp=\"${{ secrets.DEPLOY_PATH }}.tmp\"; rm -rf \"$tmp\"; mkdir -p \"$tmp\"; tar -xzf - -C \"$tmp\"; rm -rf \"${{ secrets.DEPLOY_PATH }}\"; mv \"$tmp\" \"${{ secrets.DEPLOY_PATH }}\"'"
|
||||||
|
|||||||
Reference in New Issue
Block a user