mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-25 04:43:04 +00:00
Improve GitHub Actions workflow (#289)
- Use the strategy.matrix syntax - Use peaceiris/actions-hugo: https://github.com/peaceiris/actions-hugo
This commit is contained in:
parent
f9643aa6b7
commit
f66a45df04
35
.github/workflows/main.yml
vendored
35
.github/workflows/main.yml
vendored
@ -1,32 +1,23 @@
|
|||||||
name: Build with Hugo
|
name: Build with Hugo
|
||||||
|
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
hugo-latest:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
hugo-version:
|
||||||
|
- 'latest'
|
||||||
|
- '0.68.0'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install Hugo
|
- name: Setup Hugo
|
||||||
run: |
|
uses: peaceiris/actions-hugo@v2
|
||||||
LATEST_VERSION=`curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
|
with:
|
||||||
VERSION_NO_PREFIX=`echo $LATEST_VERSION | cut -c 2-`
|
hugo-version: ${{ matrix.hugo-version }}
|
||||||
wget "https://github.com/gohugoio/hugo/releases/download/$LATEST_VERSION/hugo_extended_${VERSION_NO_PREFIX}_Linux-64bit.deb" -O /tmp/hugo.deb
|
extended: true
|
||||||
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: Run Hugo
|
- name: Run Hugo
|
||||||
working-directory: exampleSite
|
working-directory: exampleSite
|
||||||
|
Loading…
Reference in New Issue
Block a user