-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.93 KB
/
Copy pathvalidate.yml
File metadata and controls
67 lines (56 loc) · 1.93 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
63
64
65
66
67
name: Validate site
# The site deploys to Cloudflare Pages from main only (.github/workflows/deploy.yml).
# This workflow is the pull-request gate: it proves the site builds, that every
# internal link resolves, and that the download URLs the site advertises match the
# public release channel. Without it a broken build would only surface at deploy
# time, after the merge.
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
env:
ZOLA_VERSION: "0.22.1"
jobs:
build:
name: Build and check links
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Zola ${{ env.ZOLA_VERSION }}
run: |
curl --fail --location --silent --show-error \
"https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
| tar xz
sudo mv zola /usr/local/bin
zola --version
- name: Build site
# Zola fails the build on broken internal links.
run: zola build
- name: Verify the build produced pages
run: |
pages=$(find public -name '*.html' | wc -l)
echo "Generated ${pages} HTML pages"
if [ "${pages}" -lt 10 ]; then
echo "::error::Expected at least 10 generated pages, found ${pages}"
exit 1
fi
test -f public/index.html || { echo "::error::public/index.html is missing"; exit 1; }
- name: Upload site
uses: actions/upload-artifact@v4
with:
name: site-public
path: public/
retention-days: 7
release-links:
name: Check release channel links
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Verify advertised downloads exist on the public channel
run: python3 scripts/check-release-links.py