Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c67c4654b | ||
|
|
cbdb69fd85 |
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3.11.2
|
||||
FROM alpine:3.11.0
|
||||
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
|
||||
18
README.md
18
README.md
@@ -71,7 +71,6 @@ Do you want to skip the docker build step? OK, the script mode is available.
|
||||
- [⭐️ Keeping existing files](#%EF%B8%8F-keeping-existing-files)
|
||||
- [⭐️ Deploy to external repository](#%EF%B8%8F-deploy-to-external-repository)
|
||||
- [⭐️ Force orphan](#%EF%B8%8F-force-orphan)
|
||||
- [⭐️ Set Git username and email](#%EF%B8%8F-set-git-username-and-email)
|
||||
- [⭐️ Script mode](#%EF%B8%8F-script-mode)
|
||||
- [Tips and FAQ](#tips-and-faq)
|
||||
- [⭐️ Use the latest and specific release](#%EF%B8%8F-use-the-latest-and-specific-release)
|
||||
@@ -312,23 +311,6 @@ This allows you to make your publish branch with only the latest commit.
|
||||
forceOrphan: true
|
||||
```
|
||||
|
||||
### ⭐️ Set Git username and email
|
||||
|
||||
Set custom `git config user.name` and `git config user.email`.
|
||||
A commit is always created with the same user.
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./public
|
||||
with:
|
||||
username: "iris"
|
||||
useremail: "iris@peaceiris.com"
|
||||
```
|
||||
|
||||
### ⭐️ Script mode
|
||||
|
||||
From `v2.5.0`, we can run this action as a shell script.
|
||||
|
||||
@@ -20,12 +20,3 @@ inputs:
|
||||
description: 'Keep only the latest commit on a GitHub Pages branch'
|
||||
required: false
|
||||
default: 'false'
|
||||
username:
|
||||
description: 'Set Git user.name'
|
||||
required: false
|
||||
useremail:
|
||||
description: 'Set Git user.email'
|
||||
required: false
|
||||
commitMessage:
|
||||
description: 'Set custom commit message'
|
||||
required: false
|
||||
|
||||
@@ -102,34 +102,14 @@ else
|
||||
fi
|
||||
|
||||
# push to publishing branch
|
||||
if [[ -n "${INPUT_USERNAME}" ]]; then
|
||||
git config user.name "${INPUT_USERNAME}"
|
||||
else
|
||||
git config user.name "${GITHUB_ACTOR}"
|
||||
fi
|
||||
if [[ -n "${INPUT_USEREMAIL}" ]]; then
|
||||
git config user.email "${INPUT_USEREMAIL}"
|
||||
else
|
||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||
fi
|
||||
git config user.name "${GITHUB_ACTOR}"
|
||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||
git remote rm origin || true
|
||||
git remote add origin "${remote_repo}"
|
||||
git add --all
|
||||
|
||||
print_info "Allowing empty commits: ${INPUT_EMPTYCOMMITS}"
|
||||
|
||||
if [ -n "${INPUT_COMMITMESSAGE}" ]; then
|
||||
BASE_COMMIT_MESSAGE="${INPUT_COMMITMESSAGE}"
|
||||
else
|
||||
BASE_COMMIT_MESSAGE="Automated deployment: $(date -u)"
|
||||
fi
|
||||
|
||||
if [ -n "${EXTERNAL_REPOSITORY}" ]; then
|
||||
COMMIT_MESSAGE="${BASE_COMMIT_MESSAGE} ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
|
||||
else
|
||||
COMMIT_MESSAGE="${BASE_COMMIT_MESSAGE} ${GITHUB_SHA}"
|
||||
fi
|
||||
|
||||
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_SHA}"
|
||||
if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
|
||||
git commit -m "${COMMIT_MESSAGE}" || skip
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user