2022-01-25 10:10:34 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2022-01-30 15:57:58 -05:00
|
|
|
json=$(yarn netlify deploy --build --context deploy-preview --alias "$1" --json --message "[#$1] $2")
|
2022-01-25 10:10:34 -05:00
|
|
|
|
2022-03-27 17:02:37 -04:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Error while executing netlify! Will try again without json..."
|
|
|
|
yarn netlify deploy --build --context deploy-preview --alias "$1" --message "[#$1] $2"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-01-30 15:57:58 -05:00
|
|
|
echo "${json}"
|
2022-01-25 10:10:34 -05:00
|
|
|
|
|
|
|
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}"
|