Skip to content

CI build test

CI build test #12

Workflow file for this run

name: CI
on: [pull_request]
env:
HUGO_VERSION: 0.120.3
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
git grep --untracked --no-exclude-standard "\\(href\|src\) *= *[\"']/" \
-- public/ ':^public/js/jquery*' >/tmp/abs-urls.txt
cat /tmp/abs-urls.txt
test ! -s /tmp/abs-urls.txt
- 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