Skip to content

Commit ae41467

Browse files
authored
Merge pull request #102 from VectoDE/development
ci(deploy): exclude bot/data from rsync and fix permissions
2 parents b0e903b + c83c181 commit ae41467

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,19 @@ jobs:
4848
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
4949
echo "key_path=$key_file" >> "$GITHUB_OUTPUT"
5050
51+
- name: Fix permissions before sync
52+
env:
53+
ROOT_USER: ${{ secrets.DEPLOY_SSH_ROOT_USER }}
54+
ROOT_PASS: ${{ secrets.DEPLOY_SSH_ROOT_PASSWORD }}
55+
run: |
56+
ssh -o StrictHostKeyChecking=no \
57+
"${DEPLOY_SSH_USER}@${DEPLOY_SSH_HOST}" \
58+
"echo '$ROOT_PASS' | su -c 'chown -R ${DEPLOY_SSH_USER}:${DEPLOY_SSH_USER} ${DEPLOY_TARGET_PATH}' '$ROOT_USER'"
59+
5160
- name: Sync repository to server
5261
run: |
5362
ssh -o StrictHostKeyChecking=no "${DEPLOY_SSH_USER}@${DEPLOY_SSH_HOST}" "mkdir -p '${DEPLOY_TARGET_PATH}'"
54-
rsync -az --delete --exclude '.git' \
63+
rsync -az --delete --exclude '.git' --exclude 'bot/data' \
5564
-e "ssh -o StrictHostKeyChecking=no" \
5665
./ "${DEPLOY_SSH_USER}@${DEPLOY_SSH_HOST}:${DEPLOY_TARGET_PATH}/"
5766

0 commit comments

Comments
 (0)