2021-03-10 18:48:45 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-03-12 12:51:07 +03:00
|
|
|
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
|
2021-03-10 18:56:14 +03:00
|
|
|
echo "It's a PR"
|
2021-03-10 18:48:45 +03:00
|
|
|
|
2021-08-27 19:26:59 +03:00
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
export SHOULD_DEPLOY="no"
|
|
|
|
elif [[ $GITHUB_EVENT_NAME == "push" ]]; then
|
|
|
|
echo "It's a Push"
|
|
|
|
|
2021-03-10 18:48:45 +03:00
|
|
|
export SHOULD_BUILD="yes"
|
|
|
|
export SHOULD_DEPLOY="no"
|
|
|
|
else
|
2021-03-10 18:56:14 +03:00
|
|
|
echo "It's a cron"
|
|
|
|
|
2021-03-10 18:48:45 +03:00
|
|
|
export SHOULD_DEPLOY="yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $GITHUB_ENV ]]; then
|
|
|
|
echo "SHOULD_BUILD=$SHOULD_BUILD" >> $GITHUB_ENV
|
|
|
|
echo "SHOULD_DEPLOY=$SHOULD_DEPLOY" >> $GITHUB_ENV
|
|
|
|
fi
|