forked from reagent-project/reagent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-example-site.sh
executable file
·42 lines (31 loc) · 1.02 KB
/
build-example-site.sh
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
#!/bin/bash
set -e
SHA=$(git rev-parse HEAD)
lein 'do' clean, cljsbuild once prod-npm, cljsbuild once prerender
node target/cljsbuild/prerender/main.js target/cljsbuild/prod-npm/public/
lein codox
rm -fr tmp
if [[ -n $GITHUB_ACTOR ]]; then
git config --global user.email "14146879+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git clone "https://${GITHUB_ACTOR}:${SITE_TOKEN}@github.com/reagent-project/reagent-project.github.io.git" tmp
else
git clone [email protected]:reagent-project/reagent-project.github.io.git tmp
fi
# Remove everything to ensure old files are removed
rm -fr tmp/*
cp -r target/cljsbuild/prod-npm/public/* tmp/
cp -r target/prerender/public/* tmp/
mkdir -p tmp/docs/master/
cp -r target/doc/* tmp/docs/master/
test -f tmp/index.html
test -f tmp/js/main.js
test ! -e tmp/js/out
cd tmp
# Restore files not created by this script
git add docs/master/
git checkout -- README.md docs/
git add .
git commit -m "Built site from $SHA"
git push
rm -rf tmp