-
Notifications
You must be signed in to change notification settings - Fork 1.3k
42 lines (34 loc) · 1.04 KB
/
ci.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
name: CI
on: [pull_request]
env:
HUGO_VERSION: 0.124.0
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install Hugo ${{ env.HUGO_VERSION }}
run: |
set -x &&
curl -Lo /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
sudo dpkg -i /tmp/hugo.deb
- name: run Hugo to build the pages
run: hugo
- name: ensure that there are no absolute URLs
run: |
set -x
if git grep --untracked --no-exclude-standard "\\(href\|src\) *= *[\"']/" \
-- public/ ':^public/js/jquery*' >/tmp/abs-urls.txt
then
cat /tmp/abs-urls.txt
exit 1
fi
- name: run Pagefind to build the search index
run: npx -y pagefind --site public
- name: build tar archive
run: cd public && tar czvf ../pages.tar.gz *
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: pages
path: pages.tar.gz