Compare commits
7 Commits
v2.5.0
...
v2.5.0-rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a3cc6d532 | ||
|
|
727fb697cd | ||
|
|
5897005fde | ||
|
|
77afd3c2c9 | ||
|
|
039d96984d | ||
|
|
896aa8fc53 | ||
|
|
aa82ef0992 |
@@ -254,10 +254,10 @@ For example:
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v2.5.0-rc0
|
||||
uses: peaceiris/actions-gh-pages@v2.4.0
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
EXTERNAL_REPOSITORY: username/external-repository
|
||||
EXTERNAL_REPOSITORY: username/username.github.io
|
||||
PUBLISH_BRANCH: master
|
||||
PUBLISH_DIR: ./public
|
||||
```
|
||||
@@ -272,16 +272,12 @@ Be careful, `GITHUB_TOKEN` has no permission to access to external repositories.
|
||||
From `v2.5.0`, we can run this action as a shell script.
|
||||
There is no Docker build or pull step, so it will start immediately.
|
||||
|
||||
- `ACTIONS_DEPLOY_KEY` requires `SCRIPT_MODE: true`
|
||||
- `*_TOKEN` do not require `SCRIPT_MODE`
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
env:
|
||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./public
|
||||
SCRIPT_MODE: true
|
||||
run: |
|
||||
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2.5.0/entrypoint.sh
|
||||
bash ./entrypoint.sh
|
||||
|
||||
@@ -28,16 +28,10 @@ if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
|
||||
|
||||
print_info "setup with ACTIONS_DEPLOY_KEY"
|
||||
|
||||
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"
|
||||
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"
|
||||
|
||||
remote_repo="git@github.com:${PUBLISH_REPOSITORY}.git"
|
||||
|
||||
@@ -76,7 +70,7 @@ fi
|
||||
|
||||
remote_branch="${PUBLISH_BRANCH}"
|
||||
|
||||
local_dir="${HOME}/ghpages_${RANDOM}"
|
||||
local_dir="${HOME}/$(tr -cd 'a-f0-9' < /dev/urandom | head -c 32)"
|
||||
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