-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpublish
More file actions
executable file
·46 lines (29 loc) · 879 Bytes
/
publish
File metadata and controls
executable file
·46 lines (29 loc) · 879 Bytes
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
#!/bin/bash -ex
# Setup
TMP=$(mktemp -dt "$(basename $0).XXXXXXXXXXXXX")
trap "rm -rf $TMP" 0
rev=$(git rev-parse --short HEAD | tr -d "\n")
# Build
node img/import-data
npx subpkg build img
mkdir $TMP/img
cp img/index.html img/build/index.min.js img/data/index.js $TMP/img
rm -rf integration/dist
npm -C integration run gh-pages
mkdir $TMP/integration
cp integration/dist/index.html integration/dist/*.js $TMP/integration
# Checkout: main -> gh-pages
git checkout gh-pages
# Copy
cp $TMP/img/index.html img/
cp $TMP/img/index.min.js img/build/index.min.js
cp $TMP/img/index.js img/data/index.js
rm -f integration/index.html integration/*.js
cp $TMP/integration/* integration/
# Publish
git add -A .
git add -f integration/index.html integration/*.js
git commit -m "Publish: '${rev}'"
git push origin --force gh-pages
# Checkout: gh-pages -> main
git checkout -