-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·33 lines (26 loc) · 1011 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·33 lines (26 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env sh
# abort on errors
set -e
# Requires these set in your shell environment (not committed anywhere):
# DOCS_SSH_HOST, DOCS_SSH_PORT, DOCS_SSH_USER, DOCS_REMOTE_PATH
# and an SSH key authorized for that account already loaded in your agent
# (or set DOCS_SSH_KEY_PATH to a specific private key file).
: "${DOCS_SSH_HOST:?Set DOCS_SSH_HOST}"
: "${DOCS_SSH_PORT:?Set DOCS_SSH_PORT}"
: "${DOCS_SSH_USER:?Set DOCS_SSH_USER}"
: "${DOCS_REMOTE_PATH:?Set DOCS_REMOTE_PATH}"
SSH_OPTS="-p $DOCS_SSH_PORT"
if [ -n "$DOCS_SSH_KEY_PATH" ]; then
SSH_OPTS="$SSH_OPTS -i $DOCS_SSH_KEY_PATH"
fi
# Same install as CI (.github/workflows/deploy.yml): exactly the tree pinned
# in yarn.lock, no package install hooks.
yarn install --frozen-lockfile --ignore-scripts
# Reject executable Markdown before the build runs it.
yarn docs:lint
# build
rm -rf docs/.vuepress/dist
yarn docs:build
rsync -avz --delete \
-e "ssh $SSH_OPTS" \
docs/.vuepress/dist/ "$DOCS_SSH_USER@$DOCS_SSH_HOST:$DOCS_REMOTE_PATH/"