hedgedoc/netlify/deploy-main.sh
Tilman Vatteroth 3b446a605d Add error handling for netlify deployment
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-03-27 23:25:21 +02:00

21 lines
553 B
Bash

#!/bin/bash
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
json=$(yarn netlify deploy --build --prod --json --message "${1:0:8}: $2")
if [ $? -ne 0 ]; then
echo "Error while executing netlify! Will try again without json..."
yarn netlify deploy --build --prod --message "${1:0:8}: $2"
exit 1
fi
echo "${json}"
url=$(echo "${json}" | jq -r .deploy_url)
logs=$(echo "${json}" | jq -r .logs)
echo "::set-output name=url::${url}"
echo "::set-output name=logs::${logs}"