Compare commits
4 Commits
v2.5.0-rc1
...
v2.5.0-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5393785496 | ||
|
|
61ffdece86 | ||
|
|
64e2296d31 | ||
|
|
159b07d518 |
@@ -254,10 +254,10 @@ For example:
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0-rc0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
EXTERNAL_REPOSITORY: username/username.github.io
|
||||
EXTERNAL_REPOSITORY: username/external-repository
|
||||
PUBLISH_BRANCH: master
|
||||
PUBLISH_DIR: ./public
|
||||
```
|
||||
|
||||
@@ -28,10 +28,16 @@ if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
|
||||
|
||||
print_info "setup with ACTIONS_DEPLOY_KEY"
|
||||
|
||||
mkdir "${HOME}/.ssh"
|
||||
ssh-keyscan -t rsa github.com > "${HOME}/.ssh/known_hosts"
|
||||
echo "${ACTIONS_DEPLOY_KEY}" > "${HOME}/.ssh/id_rsa"
|
||||
chmod 400 "${HOME}/.ssh/id_rsa"
|
||||
if [ -n "${SCRIPT_MODE}" ]; then
|
||||
print_info "run as SCRIPT_MODE"
|
||||
SSH_DIR="${HOME}/.ssh"
|
||||
else
|
||||
SSH_DIR="/root/.ssh"
|
||||
fi
|
||||
mkdir "${SSH_DIR}"
|
||||
ssh-keyscan -t rsa github.com > "${SSH_DIR}/known_hosts"
|
||||
echo "${ACTIONS_DEPLOY_KEY}" > "${SSH_DIR}/id_rsa"
|
||||
chmod 400 "${SSH_DIR}/id_rsa"
|
||||
|
||||
remote_repo="git@github.com:${PUBLISH_REPOSITORY}.git"
|
||||
|
||||
@@ -70,7 +76,7 @@ fi
|
||||
|
||||
remote_branch="${PUBLISH_BRANCH}"
|
||||
|
||||
local_dir="${HOME}/$(tr -cd 'a-f0-9' < /dev/urandom | head -c 32)"
|
||||
local_dir="${HOME}/ghpages_${RANDOM}"
|
||||
if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
|
||||
cd "${local_dir}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user