56 lines (49 loc) · 1.49 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Build the PR's base branch files.
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}
submodules: true
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.68.0'
extended: true
- name: Build
run: hugo -d build/base
# Build the PR's head branch files.
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: true
clean: false
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.68.0'
extended: true
- name: Build
run: hugo -d build/head
# Capture page differences.
- id: diffpages
uses: ssowonny/diff-pages-action@master
with:
base-path: 'build/base'
head-path: 'build/head'
# This example step is for uploading the result as an artifact. The result or
# the artifact can be uploaded to the pull request comments, Amazon S3, or
# any place according to the github action settings.
- uses: actions/upload-artifact@v1
with:
name: diff-pages-artifact
path: '${{ steps.diffpages.outputs.path }}'