Skip to content

Commit

Permalink
Add deploy script.
Browse files Browse the repository at this point in the history
Clean up npm scripts.
Add app link to README.md.
  • Loading branch information
maxhallinan committed Oct 19, 2019
1 parent 2df0b36 commit 608ec4e
Show file tree
Hide file tree
Showing 6 changed files with 251 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
/.spago
dist
public/bundle.*
.s3cmd
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Redexer

Step through the reduction of an untyped lambda calculus term.
Play with it [here](https://redexer.maxhallinan.com/).
86 changes: 86 additions & 0 deletions _scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env bash

echo "Syncing images and fonts..."
s3cmd sync \
--acl-public \
--no-preserve \
--exclude "*.*" \
--add-header="Cache-Control:public, max-age=31557600" \
--include "*.png" \
--include "*.jpg" \
--include "*.gif" \
--include "*.ico" \
--include "*.eot" \
--include "*.svg" \
--include "*.ttf" \
--include "*.woff" \
--include "*.woff2" \
--include "*.otf" \
-c .s3cmd \
dist/ s3://redexer.maxhallinan.com

echo "Syncing html..."
s3cmd put \
--acl-public \
--no-preserve \
--recursive \
--exclude "*.*" \
--add-header="Cache-Control:public, max-age=86400, must-revalidate" \
--add-header="Expires:access plus 1 day" \
--mime-type="text/html; charset=utf-8" \
--include "*.html" \
-c .s3cmd \
dist/ s3://redexer.maxhallinan.com

echo "Syncing css..."
s3cmd put \
--acl-public \
--no-preserve \
--recursive \
--exclude "*.*" \
--add-header="Cache-Control:public, max-age=604800" \
--mime-type="text/css" \
--include "*.css" \
-c .s3cmd \
dist/ s3://redexer.maxhallinan.com

echo "Syncing js..."
s3cmd sync \
--acl-public \
--no-preserve \
--exclude "*.*" \
--add-header="Cache-Control:public, max-age=604800" \
--mime-type="application/javascript" \
--include "*.js" \
-c .s3cmd \
dist/ s3://redexer.maxhallinan.com

echo "Syncing json..."
s3cmd sync \
--acl-public \
--no-preserve \
--exclude "*.*" \
--add-header="Cache-Control:public, max-age=86400, must-revalidate" \
--mime-type="application/json" \
--include "*.json" \
-c .s3cmd \
dist/ s3://redexer.maxhallinan.com

echo "Syncing xml..."
s3cmd sync \
--acl-public \
--no-preserve \
--exclude "*.*" \
--add-header="Cache-Control:public, max-age=2629800" \
--mime-type="application/xml" \
--include "*.xml" \
-c .s3cmd \
dist/ s3://redexer.maxhallinan.com

echo "Syncing remaining and cleaning up..."
s3cmd sync \
--acl-public \
--no-preserve \
--delete-removed \
-c .s3cmd \
dist/ s3://redexer.maxhallinan.com
157 changes: 156 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
"url": "maxhallinan.com"
},
"scripts": {
"build": "spago bundle-app --main Main --to public/bundle.js; parcel build public/index.html",
"bundle-watch": "spago bundle-app --watch --main Main --to public/bundle.js",
"postinstall": "spago install",
"start": "parcel serve public/index.html",
"test": "spago test"
"build": "rm -rf ./dist; npx spago bundle-app --main Main --to public/bundle.js; npx parcel build public/index.html",
"postinstall": "npx spago install",
"serve": "npm run build; npx http-server dist",
"test": "npx spago test"
},
"dependencies": {
"strings": "^0.4.2",
Expand All @@ -20,6 +19,7 @@
},
"devDependencies": {
"browserify": "^16.5.0",
"http-server": "^0.11.1",
"parcel-bundler": "^1.12.3",
"purescript": "^0.13.3",
"purty": "^4.5.1",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="./styles.css" rel="stylesheet">
<title>Redexer</title>
<link rel="preload" as="font" type="font/woff2" href="https://static.maxhallinan.com/fonts/klim/TiemposTextWeb-Regular.woff2" crossorigin/>
<link rel="preload" as="font" type="font/woff2" href="https://static.maxhallinan.com/fonts/klim/TiemposHeadlineWeb-Semibold.woff2" crossorigin/>
<link rel="preload" as="font" type="font/woff2" href="https://static.maxhallinan.com/fonts/mb/TriplicateT3Code-Regular.woff2" crossorigin/>
<link href="./styles.css" rel="stylesheet">
</head>
<body>
<article class="article">
Expand All @@ -29,6 +29,6 @@ <h1>Redexer</h1>
</code>
</div>
</article>
<script type="text/javascript" src="bundle.browser.js"></script>
<script type="text/javascript" src="bundle.js"></script>
</body>
</html>

0 comments on commit 608ec4e

Please sign in to comment.