Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47a6d63ea8 | ||
|
|
201f9af234 |
31
README.md
31
README.md
@@ -63,13 +63,8 @@ Next, Go to **Repository Settings**
|
|||||||
|
|
||||||
#### :star: Repository type - Project
|
#### :star: Repository type - Project
|
||||||
|
|
||||||
An example yaml file with Hugo action.
|
An example workflow for Hugo.
|
||||||
|
|
||||||
- [peaceiris/actions-hugo: GitHub Actions for Hugo extended](https://github.com/peaceiris/actions-hugo)
|
|
||||||
|
|
||||||
[](https://github.com/peaceiris/actions-hugo)
|
|
||||||
|
|
||||||

|
|
||||||

|

|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -86,12 +81,19 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
- name: build
|
- name: Install Hugo
|
||||||
uses: peaceiris/actions-hugo@v0.58.1
|
env:
|
||||||
with:
|
HUGO_VERSION: '0.58.2'
|
||||||
args: --gc --minify --cleanDestinationDir
|
run: |
|
||||||
|
mkdir /tmp/hugo && cd /tmp/hugo
|
||||||
|
curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-64bit.tar.gz | \
|
||||||
|
tar -xz && \
|
||||||
|
sudo mv ./hugo /usr/local/bin/
|
||||||
|
|
||||||
- name: deploy
|
- name: Build
|
||||||
|
run: hugo --gc --minify --cleanDestinationDir
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2.3.0
|
uses: peaceiris/actions-gh-pages@v2.3.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
@@ -132,13 +134,6 @@ By pulling docker images, you can reduce the overall execution time of your work
|
|||||||
|
|
||||||
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
|
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
|
||||||
|
|
||||||
```diff
|
|
||||||
- uses: peaceiris/actions-hugo@v0.58.1
|
|
||||||
+ uses: docker://peaceiris/gha-hugo:v0.58.1
|
|
||||||
```
|
|
||||||
|
|
||||||
- [peaceiris/gha-hugo - Docker Hub](https://hub.docker.com/r/peaceiris/gha-hugo)
|
|
||||||
|
|
||||||
#### :star: `PERSONAL_TOKEN`
|
#### :star: `PERSONAL_TOKEN`
|
||||||
|
|
||||||
[Generate a personal access token (`repo`)](https://github.com/settings/tokens) and add it to Secrets as `PERSONAL_TOKEN`, it works as well as `ACTIONS_DEPLOY_KEY`.
|
[Generate a personal access token (`repo`)](https://github.com/settings/tokens) and add it to Secrets as `PERSONAL_TOKEN`, it works as well as `ACTIONS_DEPLOY_KEY`.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ remote_branch="${PUBLISH_BRANCH}"
|
|||||||
local_dir="${HOME}/$(tr -cd 'a-f0-9' < /dev/urandom | head -c 32)"
|
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
|
if git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_repo}" "${local_dir}"; then
|
||||||
cd "${local_dir}"
|
cd "${local_dir}"
|
||||||
git rm -r '*'
|
git rm -r --ignore-unmatch '*'
|
||||||
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | \
|
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | \
|
||||||
tail -n +2 | \
|
tail -n +2 | \
|
||||||
xargs -I % cp -rf % "${local_dir}/"
|
xargs -I % cp -rf % "${local_dir}/"
|
||||||
|
|||||||
Reference in New Issue
Block a user