-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentrypoint.sh
53 lines (42 loc) · 1.15 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
EMOJI_WORKING=(
"👷 Working..."
"🏃 Running..."
"🏗 Building..."
"🚧 Building..."
)
STARTING_MESSAGE=${EMOJI_WORKING[$[$RANDOM % ${#EMOJI_WORKING[@]}]]}
EMOJI_SUCCESS=(
"💯 Done!"
"🚢 Ship it!"
"🚀 Awesome!"
)
SUCCESS_MESSAGE=${EMOJI_SUCCESS[$[$RANDOM % ${#EMOJI_SUCCESS[@]}]]}
echo "$STARTING_MESSAGE"
echo ""
echo " Building with marp..."
echo ""
marp ${MARP_ARGS}
echo "✔ Built Successfully!"
echo ""
echo " Publishing to ${GITHUB_REPOSITORY} ${PUBLISH_TO_BRANCH}..."
echo ""
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" && \
git init && \
git config user.name "marp-action" && \
git config user.email "[email protected]" && \
git add . && \
git status && \
curr_branch="$(git rev-parse --abbrev-ref HEAD)" && \
commit_msg="${COMMIT_MSG:-'Marp Action Build'}" && \
git commit -m "${commit_msg}"
if [ "$NO_FORCE_PUSH" = true ]
then
git push $remote_repo ${curr_branch}:${PUBLISH_TO_BRANCH}
else
git push --force $remote_repo ${curr_branch}:${PUBLISH_TO_BRANCH}
fi
echo "✔ Pushed Successfully!"
echo ""
echo "$SUCCESS_MESSAGE"