-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (82 loc) · 3.28 KB
/
Copy pathvalidate.yml
File metadata and controls
87 lines (82 loc) · 3.28 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Hardened from Upptime v1.43.13. Review upgrades through UPSTREAM.md;
# status-page source and all Actions are pinned to immutable revisions.
name: Validate
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
config:
name: Validate status configuration
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- name: Validate
run: ruby scripts/validate.rb
static-site:
name: Build static site
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout status repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- name: Checkout pinned Upptime status page
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
repository: upptime/status-page
ref: 54c2ff5a3d998d525ee4c7e68dc7ce7414d89c33 # v1.17.0
path: site
persist-credentials: false
- name: Apply Mighty main-branch compatibility patch
run: git -C site apply --index --unidiff-zero ../patches/upptime-status-page-main.patch
- name: Stage Mighty static assets
run: cp -R assets/. site/static/
- name: Set up Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: "20"
cache: npm
cache-dependency-path: site/package-lock.json
- name: Build static site from locked dependencies
working-directory: site
env:
CYPRESS_INSTALL_BINARY: "0"
run: |
npm ci --no-audit --no-fund
npm run export
- name: Verify generated output
run: |
test -s site/__sapper__/export/index.html
test -s site/__sapper__/export/manifest.json
test -s site/__sapper__/export/_headers
test -f site/__sapper__/export/mighty-logo.png
test "$(wc -c < site/__sapper__/export/mighty-logo.png)" -gt 1000
test -f site/__sapper__/export/favicon.png
test "$(wc -c < site/__sapper__/export/favicon.png)" -gt 1000
test -s site/__sapper__/export/mighty-theme.css
test -s site/__sapper__/export/status-social-card.png
test -s site/__sapper__/export/robots.txt
test -s site/__sapper__/export/sitemap.xml
test -s site/__sapper__/export/llms.txt
grep -q 'Mighty Service Status' site/__sapper__/export/manifest.json
grep -q 'content=#fbf7ee' site/__sapper__/export/index.html
grep -q 'href=/favicon.png' site/__sapper__/export/index.html
grep -q 'Mighty detects manipulated documents and media' site/__sapper__/export/index.html
grep -q 'application/ld+json' site/__sapper__/export/index.html
for component in website api scan-gateway; do
test -s "site/__sapper__/export/history/${component}/index.html"
done