aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
diff options
context:
space:
mode:
authorShohei Ueda <30958501+peaceiris@users.noreply.github.com>2020-11-15 05:40:00 +0900
committerGitHub <noreply@github.com>2020-11-14 21:40:00 +0100
commitf66a45df04ef4d42a5a91c333b3759059b16386f (patch)
tree3770e38d44b9c7c046dd6f7a19ce678907d31991 /.github/workflows/main.yml
parentf9643aa6b741d37db2796a9ad44a5ed665012281 (diff)
Improve GitHub Actions workflow (#289)
- Use the strategy.matrix syntax - Use peaceiris/actions-hugo: https://github.com/peaceiris/actions-hugo
Diffstat (limited to '.github/workflows/main.yml')
-rw-r--r--.github/workflows/main.yml35
1 files changed, 13 insertions, 22 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 19f30e9..67f73e1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,32 +1,23 @@
name: Build with Hugo
-on: [push]
+on: [push, pull_request]
jobs:
- hugo-latest:
+ build:
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ hugo-version:
+ - 'latest'
+ - '0.68.0'
steps:
- - uses: actions/checkout@master
+ - uses: actions/checkout@v2
- - name: Install Hugo
- run: |
- LATEST_VERSION=`curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
- VERSION_NO_PREFIX=`echo $LATEST_VERSION | cut -c 2-`
- wget "https://github.com/gohugoio/hugo/releases/download/$LATEST_VERSION/hugo_extended_${VERSION_NO_PREFIX}_Linux-64bit.deb" -O /tmp/hugo.deb
- sudo dpkg -i /tmp/hugo.deb
-
- - name: Run Hugo
- working-directory: exampleSite
- run: hugo --themesDir ../..
- hugo-minimum:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@master
-
- - name: Install Hugo
- run: |
- wget "https://github.com/gohugoio/hugo/releases/download/v0.68.0/hugo_extended_0.68.0_Linux-64bit.deb" -O /tmp/hugo.deb
- sudo dpkg -i /tmp/hugo.deb
+ - name: Setup Hugo
+ uses: peaceiris/actions-hugo@v2
+ with:
+ hugo-version: ${{ matrix.hugo-version }}
+ extended: true
- name: Run Hugo
working-directory: exampleSite