-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (64 loc) · 1.86 KB
/
site.yaml
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
66
67
name: Deploy site
on:
push:
branches:
- scratch/deploy-site
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Hugo
shell: bash
run: |
tdir=$(mktemp -d)
tgz=$tdir/hugo.tar.gz
bin=$HOME/bin
mkdir -p "$bin"
url=https://github.com/gohugoio/hugo/releases/download
curl -fSsL --retry 3 \
"$url/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" \
>"$tgz"
printf '%s %s\n' "$HUGO_SHA" "$tgz" | sha256sum --check >/dev/null
tar --to-stdout --extract -zf "$tgz" hugo >"$bin"/hugo
chmod +x "$bin/hugo"
"$bin"/hugo version
echo "$bin" >>"$GITHUB_PATH"
env:
HUGO_VERSION: '0.133.0'
HUGO_SHA: '372530e2de9ae74087a987ca841429390a055123b8a4dec665cc601f10dc8e6e'
- uses: actions/configure-pages@v5
id: pages
- name: Check URL match
shell: bash
run: |
url=$(grep '^baseURL:' docs/site/hugo.yaml)
test "${{ steps.pages.outputs.base_url }}/" = "${url#baseURL: }"
- name: Build site
shell: bash
run: make -C docs/site build
env:
HUGO_ENVIRONMENT: production
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
TZ: America/New_York
- name: Upload site
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/site/public
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4