release v1.1.0 (#4)

* change: use GITHUB_TOKEN instead of ACTIONS_DEPLOY_KEY

* enhance: entrypoint.sh

* update: readme for v1.1.0 (Fixes #3)

* remove: images/patreon.jpg
This commit is contained in:
Shohei Ueda authored and GitHub committed 2019-08-07 22:43:26 +09:00
1 parent 1f78e2b780
commit 5af287f677
3 files changed
+19 -38

No files matched your search

+13 -13
View File
@@ -1,31 +1,31 @@
#!/bin/sh
# setup ssh
if [ -z "${ACTIONS_DEPLOY_KEY}" ]; then
echo "error: not found ACTIONS_DEPLOY_KEY"
# check values
if [ -z "${GITHUB_TOKEN}" ]; then
echo "error: not found GITHUB_TOKEN"
exit 1
fi
if [ -z "${PUBLISH_BRANCH}" ]; then
echo "error: not found PUBLISH_BRANCH"
exit 1
fi
mkdir /root/.ssh
ssh-keyscan -t rsa github.com > /root/.ssh/known_hosts
echo "${ACTIONS_DEPLOY_KEY}" > /root/.ssh/id_rsa
chmod 400 /root/.ssh/id_rsa
# push to gh-pages branch
if [ -z "${PUBLISH_DIR}" ]; then
echo "error: not found PUBLISH_DIR"
exit 1
fi
cd "${PUBLISH_DIR}" || exit 1
if [ -z "${PUBLISH_BRANCH}" ]; then
echo "error: not found PUBLISH_BRANCH"
exit 1
fi
remote_repo="git@github.com:${GITHUB_REPOSITORY}.git"
# initialize git
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
remote_branch="${PUBLISH_BRANCH}"
git init
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote add origin "${remote_repo}"
# push to publishing branch
git checkout "${remote_branch}" || git checkout --orphan "${remote_branch}"
git add --all
timestamp=$(date -u)