From 05540a46afa3d01d4b191ff44e867d7ca0416b17 Mon Sep 17 00:00:00 2001
From: Nick Schonning <nschonni@gmail.com>
Date: Wed, 9 Sep 2020 22:27:42 -0400
Subject: [PATCH] chore: GitHub Action to check examples index.html

Closes #1366
---
 .github/workflows/examples.yml | 31 +++++++++++++++++++++++++++++++
 package.json                   |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 .github/workflows/examples.yml

diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml
new file mode 100644
index 0000000000..56b05425f8
--- /dev/null
+++ b/.github/workflows/examples.yml
@@ -0,0 +1,31 @@
+name: Check examples/index.html
+
+on:
+  pull_request:
+    paths:
+      - "package*.json"
+      - ".github/workflows/examples.yml"
+      - "examples/**"
+      - "scripts/reference-tables.*"
+  push:
+    paths:
+      - "package*.json"
+      - ".github/workflows/examples.yml"
+      - "examples/**"
+      - "scripts/reference-tables.*"
+
+jobs:
+  deploy:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Install dependencies
+        run: npm ci
+
+      - name: Generate examples/index.html
+        run: npm run reference-tables
+
+      - name: Ensure no git changes
+        run: git diff --exit-code
diff --git a/package.json b/package.json
index c554d24d26..41e02d168a 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
     "lint:js": "npm run lint:es",
     "lint:html": "npm run vnu-jar",
     "lint:spelling": "cspell \"examples/**/*.html\" \"aria-practices.html\"",
+    "reference-tables": "node scripts/reference-tables.js",
     "regression": "ava --timeout=1m",
     "regression-report": "node test/util/report",
     "test": "npm run lint && npm run regression",