Skip to content

Commit

Permalink
Deploy to GitHub pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jan 17, 2022
1 parent 963ae0f commit 145d3c9
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: GitHub Pages

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build
run: |
npm install
make build-pages
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
folder: dist/pages
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/lgarron/Makefile-scripts

# Note: the first command becomes the default `make` target.
NPM_COMMANDS = build build-js build-types dev clean test lint format prepack postpublish
NPM_COMMANDS = build build-js build-types build-pages dev clean test lint format prepack postpublish

.PHONY: $(NPM_COMMANDS)
$(NPM_COMMANDS):
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
},
"scripts": {
"build": "npm run build-js && npm run build-types",
"build-js": "node script/build.js",
"build-js": "node script/build-js.js",
"build-types": "npx tsc -p tsconfig-types.json",
"build-pages": "node script/build-pages.js",
"dev": "node script/dev.js",
"clean": "rm -rf ./.temp ./dist",
"test": "npx jest && npm run lint",
Expand Down
1 change: 1 addition & 0 deletions script/build.js → script/build-js.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { barelyServe } from "barely-a-dev-server";
import { build } from "esbuild";
import { readFileSync } from "fs";
import { chmod } from "fs/promises";
Expand Down
7 changes: 7 additions & 0 deletions script/build-pages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { barelyServe } from "barely-a-dev-server";

barelyServe({
dev: false,
entryRoot: "src/dev",
outDir: "./dist/pages",
});
1 change: 0 additions & 1 deletion src/dev/inspector/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import "regenerator-runtime/runtime";
import "./inspector";
import { base64urlToBuffer } from "../../webauthn-json/base64url";
import { CredentialCreationOptionsJSON } from "../../webauthn-json/basic/json";
Expand Down

0 comments on commit 145d3c9

Please sign in to comment.