File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change 6666 # LICENSE version and ISO8601 timestamp
6767 echo -n "$(git log -n 1 --pretty='%h %aI' ./LICENSE.txt)" >> ./etc/.rsync-version
6868
69- - name : Compress Artifacts
70- run : zip -r ${{ env.CLEAN_BRANCH_NAME }}.zip . -x@etc/deploy-ignore.txt
71-
7269 - name : Deploy to Remote
7370 env :
7471 SSH_KNOWN_HOSTS : ${{ secrets.SSH_KNOWN_HOSTS }}
@@ -89,19 +86,11 @@ jobs:
8986 chmod -v 400 "${HOME}/.ssh/id_${SSH_USER}"
9087
9188 # Deploy artifact to the remote
92- scp -i "${HOME}/.ssh/id_${SSH_USER}" -P "${SSH_PORT}" "${CLEAN_BRANCH_NAME}.zip" "${SSH_USER}@${SSH_HOST}:${SSH_WEB_PATH}/"
93-
94- # SSH to remote and process artifact
95- ssh -i "${HOME}/.ssh/id_${SSH_USER}" -p "${SSH_PORT}" "${SSH_USER}@${SSH_HOST}" << EOF
96- set -ex -o pipefail
97- cd ${SSH_WEB_PATH}/
98- rm -rfv ./${CLEAN_BRANCH_NAME}/
99- mkdir -pv ./${CLEAN_BRANCH_NAME}/
100- mv -v ./${CLEAN_BRANCH_NAME}.zip ./${CLEAN_BRANCH_NAME}/
101- cd ./${CLEAN_BRANCH_NAME}/
102- unzip -o ./${CLEAN_BRANCH_NAME}.zip
103- rm ./${CLEAN_BRANCH_NAME}.zip
104- EOF
89+ rsync -avzc --delete --delete-excluded --delete-after --progress \
90+ --exclude-from="./etc/deploy-ignore.txt" \
91+ --chown=${SSH_USER}:${SSH_USER} \
92+ -e "ssh -i ${HOME}/.ssh/id_${SSH_USER} -p ${SSH_PORT}" \
93+ "./" "${SSH_USER}@${SSH_HOST}:${SSH_WEB_PATH}"
10594
10695 # Cleanup the secret
10796 rm -fv "${HOME}/.ssh/id_${SSH_USER}" "${HOME}/.ssh/id_${SSH_USER}.pub"
You can’t perform that action at this time.
0 commit comments