Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2eee632d78 |
60
README.md
60
README.md
@@ -72,7 +72,6 @@ Do you want to skip the docker build step? OK, the script mode is available.
|
||||
- [⭐️ 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)
|
||||
- [⭐️ Set custom commit message](#%EF%B8%8F-set-custom-commit-message)
|
||||
- [⭐️ 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)
|
||||
@@ -86,7 +85,6 @@ Do you want to skip the docker build step? OK, the script mode is available.
|
||||
- [⭐️ Static Site Generators with Python](#%EF%B8%8F-static-site-generators-with-python)
|
||||
- [⭐️ mdBook (Rust)](#%EF%B8%8F-mdbook-rust)
|
||||
- [⭐️ Flutter Web](#%EF%B8%8F-flutter-web)
|
||||
- [⭐️ Elm](#%EF%B8%8F-elm)
|
||||
- [License](#license)
|
||||
- [About the author](#about-the-author)
|
||||
|
||||
@@ -331,22 +329,6 @@ A commit is always created with the same user.
|
||||
useremail: "iris@peaceiris.com"
|
||||
```
|
||||
|
||||
### ⭐️ Set custom commit message
|
||||
|
||||
Set custom commit message.
|
||||
When we create a commit with a message `docs: Update some post`, a deployment commit will be generated with a message `docs: Update some post ${GITHUB_SHA}`.
|
||||
|
||||
```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:
|
||||
commitMessage: ${{ github.event.head_commit.message }}
|
||||
```
|
||||
|
||||
### ⭐️ Script mode
|
||||
|
||||
From `v2.5.0`, we can run this action as a shell script.
|
||||
@@ -786,48 +768,6 @@ jobs:
|
||||
PUBLISH_DIR: ./build/web
|
||||
```
|
||||
|
||||
### ⭐️ Elm
|
||||
|
||||
An exapmle workflow for [Elm] with [justgook/setup-elm].
|
||||
|
||||
[Elm]: https://elm-lang.org
|
||||
[justgook/setup-elm]: https://github.com/justgook/setup-elm
|
||||
|
||||
```yaml
|
||||
name: github pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Elm
|
||||
uses: justgook/setup-elm@v1
|
||||
|
||||
- name: Make
|
||||
run: elm make --optimize src/Main.elm
|
||||
|
||||
- name: Move files
|
||||
run: |
|
||||
mkdir ./public
|
||||
mv ./index.html ./public/
|
||||
# If you have non-minimal setup with some assets and separate html/js files,
|
||||
# provide --output=<output-file> option for `elm make` and remove this step
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./public
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
- [MIT License - peaceiris/actions-gh-pages]
|
||||
|
||||
13
action.yml
13
action.yml
@@ -26,16 +26,3 @@ inputs:
|
||||
useremail:
|
||||
description: 'Set Git user.email'
|
||||
required: false
|
||||
commitMessage:
|
||||
description: 'Set custom commit message'
|
||||
required: false
|
||||
tagName:
|
||||
description: 'Set tag name'
|
||||
required: false
|
||||
tagMessage:
|
||||
description: 'Set tag message'
|
||||
required: false
|
||||
tagOverwrite:
|
||||
description: 'Enable overwriting tag'
|
||||
required: false
|
||||
default: false
|
||||
|
||||
@@ -118,16 +118,10 @@ 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}"
|
||||
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
|
||||
else
|
||||
COMMIT_MESSAGE="${BASE_COMMIT_MESSAGE} ${GITHUB_SHA}"
|
||||
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_SHA}"
|
||||
fi
|
||||
|
||||
if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
|
||||
@@ -142,22 +136,4 @@ else
|
||||
git push origin "${remote_branch}"
|
||||
fi
|
||||
|
||||
if [[ -n "${INPUT_TAGNAME}" ]]; then
|
||||
print_info "Tag name: ${INPUT_TAGNAME}"
|
||||
print_info "Tag message: ${INPUT_TAGMESSAGE}"
|
||||
print_info "Tag overwrite: ${INPUT_TAGOVERWRITE}"
|
||||
if [[ -n "${INPUT_TAGMESSAGE}" ]]; then
|
||||
GIT_TAG_MESSAGE="${INPUT_TAGMESSAGE}"
|
||||
else
|
||||
GIT_TAG_MESSAGE="Deployment ${INPUT_TAGNAME}"
|
||||
fi
|
||||
if [[ "${INPUT_TAGOVERWRITE}" == "true" ]]; then
|
||||
GIT_TAG_OPTION="--force"
|
||||
else
|
||||
GIT_TAG_OPTION=""
|
||||
fi
|
||||
git tag "${GIT_TAG_OPTION}" -a "${INPUT_TAGNAME}" -m "${GIT_TAG_MESSAGE}"
|
||||
git push "${GIT_TAG_OPTION}" origin "${INPUT_TAGNAME}"
|
||||
fi
|
||||
|
||||
print_info "${GITHUB_SHA} was successfully deployed"
|
||||
|
||||
Reference in New Issue
Block a user