-
Notifications
You must be signed in to change notification settings - Fork 86
62 lines (54 loc) · 2.09 KB
/
Copy pathci.yml
File metadata and controls
62 lines (54 loc) · 2.09 KB
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
name: CI
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 2 * * *' # every day at 02:00 UTC
workflow_dispatch:
jobs:
documentation:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '22'
- name: Restore cache
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Build docs
run: |
npm run antora
# Build the Pagefind search index and fail the build if it is empty.
# pagefind exits 0 even when it indexes nothing (e.g. the output dir
# moved or no indexable pages were emitted), which would deploy a site
# with silently broken search. Require a non-trivial page count.
npm run pagefind | tee pagefind.log
grep -qE 'Indexed [1-9][0-9]+ pages' pagefind.log || {
echo '::error::Pagefind indexed fewer than 10 pages - search index looks broken'
exit 1
}
rm -f pagefind.log
echo 'doc.owncloud.com' > public/CNAME
- name: Save cache
if: github.event_name == 'push'
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Deploy to GitHub Pages
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages