Skip to content

Commit

Permalink
add npm run deploy target (#220)
Browse files Browse the repository at this point in the history
This only works for folks with SSH access to my website, i.e. me.

Perhaps in the future we could deploy with a Github action!
  • Loading branch information
mkeeter authored Dec 29, 2024
1 parent ae29170 commit 9a4e36b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions demos/web-editor/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"scripts": {
"build-wasm": "cd ../crate && wasm-pack build --target web --release",
"build-web": "webpack --mode production",
"build-static": "cp src/index.html serve.json dist/",
"build-static": "sed \"s/VERSION/$(git log --pretty=format:'%h' -n 1)/g;s/MOD/$(git diff --quiet --exit-code || echo +)/g\" src/index.html > dist/index.html && grep 'Header add' ../README.md > dist/.htaccess",
"dist": "npm run build-wasm && npm run build-web && npm run build-static",
"serve": "npm run dist && serve -c serve.json dist",
"format": "prettier . --write"
"serve": "npm run dist && serve -c ../serve.json dist",
"format": "prettier . --write",
"deploy": "rm dist/* && npm run dist && rsync -avz --delete -e ssh ./dist/ mkeeter@mattkeeter.com:mattkeeter.com/projects/fidget/demo"
},
"dependencies": {
"@lezer/lr": "^1.0.0",
Expand Down
16 changes: 16 additions & 0 deletions demos/web-editor/web/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
flex: 50%;
max-width: calc(min(100%, 512px));
}
div#version {
font-family: monospace;
}
</style>
</head>
<body>
Expand All @@ -57,6 +60,19 @@
</select>
</div>
</div>
<div id="version">
<p>
<a href="https://github.com/mkeeter/fidget">Github</a> |
<a href="https://mattkeeter.com/projects/fidget">Writeup</a>
</p>

<p>
Version:
<a href="https://github.com/mkeeter/fidget/commit/VERSION">
VERSIONMOD</a
>
</p>
</div>
<script src="index.js"></script>
</body>
</html>

0 comments on commit 9a4e36b

Please sign in to comment.