2023-07-20 21:25:13 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# shellcheck disable=SC2129
|
2021-03-10 18:48:45 +03:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-06-05 22:30:23 +03:00
|
|
|
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
|
2021-03-10 18:56:14 +03:00
|
|
|
echo "It's a PR"
|
2022-08-16 14:51:45 +03:00
|
|
|
|
2024-02-22 15:34:57 +03:00
|
|
|
export SHOULD_BUILD="yes"
|
2021-08-27 19:26:59 +03:00
|
|
|
export SHOULD_DEPLOY="no"
|
2022-06-05 22:30:23 +03:00
|
|
|
elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
|
2021-08-27 19:26:59 +03:00
|
|
|
echo "It's a Push"
|
2022-08-16 14:51:45 +03:00
|
|
|
|
2021-03-10 18:48:45 +03:00
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
export SHOULD_DEPLOY="no"
|
2022-08-16 14:51:45 +03:00
|
|
|
elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
|
2023-12-17 02:30:20 +03:00
|
|
|
if [[ "${GENERATE_ASSETS}" == "true" ]]; then
|
|
|
|
echo "It will generate the assets"
|
2022-08-16 14:51:45 +03:00
|
|
|
|
2023-08-04 15:36:30 +03:00
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
export SHOULD_DEPLOY="no"
|
|
|
|
else
|
|
|
|
echo "It's a Dispatch"
|
|
|
|
|
|
|
|
export SHOULD_DEPLOY="yes"
|
|
|
|
fi
|
2021-03-10 18:48:45 +03:00
|
|
|
else
|
2022-08-16 14:51:45 +03:00
|
|
|
echo "It's a Cron"
|
|
|
|
|
2021-03-10 18:48:45 +03:00
|
|
|
export SHOULD_DEPLOY="yes"
|
|
|
|
fi
|
|
|
|
|
2023-08-04 15:36:30 +03:00
|
|
|
if [[ "${GITHUB_ENV}" ]]; then
|
2022-10-23 20:53:10 +03:00
|
|
|
echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> "${GITHUB_ENV}"
|
2023-07-20 21:25:13 +03:00
|
|
|
echo "SHOULD_BUILD=${SHOULD_BUILD}" >> "${GITHUB_ENV}"
|
|
|
|
echo "SHOULD_DEPLOY=${SHOULD_DEPLOY}" >> "${GITHUB_ENV}"
|
2022-10-23 20:53:10 +03:00
|
|
|
echo "VSCODE_QUALITY=${VSCODE_QUALITY}" >> "${GITHUB_ENV}"
|
2022-08-16 14:51:45 +03:00
|
|
|
fi
|