forked from Azure/AppService
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment-script.sh
More file actions
30 lines (25 loc) · 849 Bytes
/
deployment-script.sh
File metadata and controls
30 lines (25 loc) · 849 Bytes
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
#!/bin/sh
echo '👍 INSTALLING THE GEM BUNDLE'
bundle install
bundle list | grep "jekyll ("
echo '👍 BUILDING THE SITE'
echo "Jekyll env = ${JEKYLL_ENV}"
bundle exec jekyll build
echo '👍 PUSHING IT BACK TO GITHUB-PAGES'
cd _site
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
remote_branch="gh-pages"
git init
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "Automated deployment triggered by ${GITHUB_SHA}"
#git remote add origin "${remote_repo}"
git push --force $remote_repo master:$remote_branch
rm -fr .git
cd ../
echo '👍 GREAT SUCCESS!'
# Examples:
# - https://github.com/JamesIves/github-pages-deploy-action/blob/master/entrypoint.sh
# - https://github.com/maxheld83/ghpages/blob/master/entrypoint.sh
# -