-
-
Notifications
You must be signed in to change notification settings - Fork 5
65 lines (63 loc) · 1.95 KB
/
build.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
57
58
59
60
61
62
63
64
65
name: Build Hugo site
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:
inputs:
logLevel:
default: 'warning'
jobs:
transform:
# Workaround for https://github.com/actions/runner-images/issues/6680
runs-on: ubuntu-20.04
steps:
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Checkout
id: checkout
uses: actions/checkout@master
with:
submodules: false
# Setting true above seems to lead to submodule updation problems.
fetch-depth: 1
- name: Update submodules
id: update_submods
run: |
set -o xtrace
git submodule update --init --recursive
git submodule update --remote --merge --recursive
- name: Get changed files
id: changed-files
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: tj-actions/changed-files@v41
with:
files_ignore: |
static/**
content/**
- name: Setup Hugo
id: setup_hugo
if: ${{ steps.changed-files.conclusion == 'skipped' || steps.changed-files.outputs.any_changed == 'true'}}
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.122.0"
# extended: true
# Step 3 - Clean and don't fail
- name: Clean build_github directory
id: clean_build
if: steps.setup_hugo.conclusion == 'success'
run: rm -rf build_github
- name: Build hugo site pages
id: hugo_build
if: steps.clean_build.conclusion == 'success'
run: |
hugo
- name: Deploy
if: ${{ github.event_name != 'pull_request' && steps.hugo_build.conclusion == 'success'}}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build_github
publish_branch: gh-pages
force_orphan: true # git history growth - even on non-src branches - makes cloning slow.