-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (50 loc) · 1.32 KB
/
publish.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
name: Publish
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
build:
name: GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23.x'
- name: Install dependencies
run: go get ./...
- name: Run doc tests
run: |
go test -v ./docs/content/...
- name: Run benchmark tables
run: |
go run ./benchmark/table | tee docs/content/background/_benchmarks.md
- name: Copy changelog
run: |
cp ./CHANGELOG.md ./docs/content/background/_changelog.md
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.121.0'
- name: Build Site
run: hugo -s docs --noChmod
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: public
path: docs/public
- name: Deploy to GitHub Pages
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: docs/public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}