mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-01-25 12:22:17 +01:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79fb16c8e4 | ||
|
|
d08dcd0297 | ||
|
|
1daa8a255f | ||
|
|
46fbb349ce | ||
|
|
d079faea7e | ||
|
|
b9842008ed | ||
|
|
021efbc871 | ||
|
|
b8232e8a2c | ||
|
|
b101526f7f | ||
|
|
f7fd45cb9e | ||
|
|
09ca2911f5 | ||
|
|
105e2e8ee3 |
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
- [ ] upgrade: hugo to ``
|
||||
- [ ] update: tag on readme
|
||||
- [ ] release: `` with **master** branch
|
||||
9
.github/main.workflow
vendored
9
.github/main.workflow
vendored
@@ -1,9 +0,0 @@
|
||||
workflow "Main workflow" {
|
||||
on = "push"
|
||||
resolves = ["docker-build"]
|
||||
}
|
||||
|
||||
action "docker-build" {
|
||||
uses = "actions/docker/cli@master"
|
||||
args = "build -t peaceiris/actions-hugo ."
|
||||
}
|
||||
18
.github/workflows/push.yml
vendored
Normal file
18
.github/workflows/push.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Push workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- invalid-tag
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Docker build and print Hugo version
|
||||
if: github.event.deleted == false
|
||||
run: |
|
||||
docker build -t peaceiris/actions-hugo . &&
|
||||
docker run peaceiris/actions-hugo:latest version ||
|
||||
(echo -e "\e[31mfailed to build\e[m" && exit 1)
|
||||
26
Dockerfile
26
Dockerfile
@@ -1,7 +1,7 @@
|
||||
FROM debian:9-slim
|
||||
FROM golang:1.12.7-buster
|
||||
|
||||
LABEL "com.github.actions.name"="Hugo extended action"
|
||||
LABEL "com.github.actions.description"="GitHub Actions for Hugo extended version"
|
||||
LABEL "com.github.actions.name"="Hugo action"
|
||||
LABEL "com.github.actions.description"="GitHub Actions for Hugo extended and Hugo Modules"
|
||||
LABEL "com.github.actions.icon"="package"
|
||||
LABEL "com.github.actions.color"="yellow"
|
||||
|
||||
@@ -9,19 +9,11 @@ LABEL "repository"="https://github.com/peaceiris/actions-hugo"
|
||||
LABEL "homepage"="https://github.com/peaceiris/actions-hugo"
|
||||
LABEL "maintainer"="peaceiris"
|
||||
|
||||
ENV HUGO_VERSION='0.56.0'
|
||||
ENV HUGO_VERSION='0.57.1'
|
||||
ENV HUGO_NAME="hugo_extended_${HUGO_VERSION}_Linux-64bit"
|
||||
ENV HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_NAME}.deb"
|
||||
ENV BUILD_DEPS="wget ca-certificates"
|
||||
ENV HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_NAME}.tar.gz"
|
||||
RUN wget "${HUGO_URL}" && \
|
||||
tar -zxvf "${HUGO_NAME}.tar.gz" && \
|
||||
mv ./hugo /go/bin/
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends git ${BUILD_DEPS} && \
|
||||
wget "${HUGO_URL}" && \
|
||||
apt-get install -y --no-install-recommends "./${HUGO_NAME}.deb" && \
|
||||
rm -rf "./${HUGO_NAME}.deb" "${HUGO_NAME}" && \
|
||||
apt-get remove -y ${BUILD_DEPS} && \
|
||||
apt-get autoremove -y && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENTRYPOINT [ "/usr/local/bin/hugo" ]
|
||||
ENTRYPOINT [ "/go/bin/hugo" ]
|
||||
|
||||
54
README.md
54
README.md
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
|
||||
## GitHub Actions for Hugo extended
|
||||
## GitHub Actions for Hugo extended and Modules
|
||||
|
||||
- [gohugoio/hugo: The world’s fastest framework for building websites.](https://github.com/gohugoio/hugo)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
## Getting started
|
||||
|
||||
### Create `main.workflow`
|
||||
### Create `.github/workflows/push.yml`
|
||||
|
||||
An example with [GitHub Actions for deploying to GitHub Pages with Static Site Generators]
|
||||
|
||||
@@ -23,39 +23,37 @@ An example with [GitHub Actions for deploying to GitHub Pages with Static Site G
|
||||

|
||||

|
||||
|
||||
```hcl
|
||||
workflow "GitHub Pages" {
|
||||
on = "push"
|
||||
resolves = ["deploy"]
|
||||
}
|
||||
```yaml
|
||||
name: Main workflow
|
||||
|
||||
action "is-branch-master" {
|
||||
uses = "actions/bin/filter@master"
|
||||
args = "branch master"
|
||||
}
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
action "build" {
|
||||
needs = "is-branch-master"
|
||||
uses = "peaceiris/actions-hugo@v0.56.0"
|
||||
args = ["--gc", "--minify", "--cleanDestinationDir"]
|
||||
}
|
||||
|
||||
action "deploy" {
|
||||
needs = "build"
|
||||
uses = "peaceiris/actions-gh-pages@v1.0.1"
|
||||
env = {
|
||||
PUBLISH_DIR = "./public"
|
||||
PUBLISH_BRANCH = "gh-pages"
|
||||
}
|
||||
secrets = ["ACTIONS_DEPLOY_KEY"]
|
||||
}
|
||||
jobs:
|
||||
build-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: build
|
||||
uses: peaceiris/actions-hugo@v0.57.1
|
||||
with:
|
||||
args: --gc --minify --cleanDestinationDir
|
||||
- name: deploy
|
||||
uses: peaceiris/actions-gh-pages@v1.1.0
|
||||
if: contains(github.ref, 'master')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PUBLISH_BRANCH: gh-pages
|
||||
PUBLISH_DIR: ./public
|
||||
```
|
||||
|
||||
|
||||
|
||||
## License
|
||||
|
||||
[MIT License - peaceiris/actions-hugo]
|
||||
- [MIT License - peaceiris/actions-hugo]
|
||||
|
||||
[MIT License - peaceiris/actions-hugo]: https://github.com/peaceiris/actions-hugo/blob/master/LICENSE
|
||||
|
||||
@@ -64,5 +62,3 @@ action "deploy" {
|
||||
## About the author
|
||||
|
||||
- [peaceiris's homepage](https://peaceiris.com/)
|
||||
|
||||
<a href="https://www.patreon.com/peaceiris"><img src="./images/patreon.jpg" alt="peaceiris - Patreon" width="150px"></a>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.4 KiB |
Reference in New Issue
Block a user