check for ssh key
This commit is contained in:
parent
c97551b0ee
commit
37da2de5a1
1 changed files with 5 additions and 1 deletions
|
@ -6,7 +6,10 @@ SSH_KEY_FILE=/tmp/gitea-pages-ssh-key-$(date +%s)
|
||||||
echo "${INPUT_SSH_KEY}" >> "${SSH_KEY_FILE}"
|
echo "${INPUT_SSH_KEY}" >> "${SSH_KEY_FILE}"
|
||||||
chmod 600 "${SSH_KEY_FILE}"
|
chmod 600 "${SSH_KEY_FILE}"
|
||||||
|
|
||||||
cat "${SSH_KEY_FILE}"
|
if [ ! -s "${SSH_KEY_FILE}" ]; then
|
||||||
|
echo "Missing ssh key, aborting deploy."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# set up ssh remote key
|
# set up ssh remote key
|
||||||
echo "${INPUT_HOST} ${INPUT_HOST_KEY}" >> ~/.ssh/known_hosts
|
echo "${INPUT_HOST} ${INPUT_HOST_KEY}" >> ~/.ssh/known_hosts
|
||||||
|
@ -14,6 +17,7 @@ echo "${INPUT_HOST} ${INPUT_HOST_KEY}" >> ~/.ssh/known_hosts
|
||||||
# check if directory present
|
# check if directory present
|
||||||
if [ ! -d "${INPUT_DIRECTORY}" ]; then
|
if [ ! -d "${INPUT_DIRECTORY}" ]; then
|
||||||
echo "Directory ${INPUT_DIRECTORY} does not exist, aborting deploy."
|
echo "Directory ${INPUT_DIRECTORY} does not exist, aborting deploy."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# optionally: create index
|
# optionally: create index
|
||||||
|
|
Loading…
Reference in a new issue