fix(ci): add test && avoid deploy per push

pull/2/head
Coelacanthus 2020-10-30 23:47:11 +08:00
parent 6120d8fd23
commit cbb9da2b8b
2 changed files with 36 additions and 4 deletions

View File

@ -2,10 +2,8 @@ name: Publish Site
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
- 'LICENSE'

View File

@ -0,0 +1,34 @@
name: Test Site
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
submodules: true
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true
- uses: actions/cache@v2
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Build
run: hugo --gc --minify --cleanDestinationDir