-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwercker.yml
57 lines (47 loc) Β· 1.81 KB
/
wercker.yml
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
47
48
49
50
51
52
53
54
55
56
57
box: node:6
build:
steps:
- script:
name: install dependencies with yarn
code: |
npm install -g yarn --quiet --depth 0
export YARN_CACHE=$WERCKER_CACHE_DIR/yarn
HOME=$YARN_CACHE yarn --pure-lockfile
- script:
name: build
code: yarn run build
- script:
name: build history page
code: |
rm .babelrc
yarn run doc:build
deploy:
steps:
- script:
name: deploy gh-pages
code: |
# prepare commit message
WERCKER_GIT_COMMIT_MESSAGE=`git log -1 --pretty='%s'`
# prepare the git directory
mkdir gh-pages
cd gh-pages
git init .
git config --global user.email "pleasemailus@wercker.com"
git config --global user.name "werckerbot"
git remote add -t gh-pages github "https://$GH_TOKEN@github.com/$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY.git"
git pull github
git checkout -b gh-pages github/gh-pages
# copy the built files
mkdir $WERCKER_GIT_COMMIT
cp ../dist/* $WERCKER_GIT_COMMIT
# copy the built files
mkdir -p latest
cp -f ../dist/* latest
# write the index
echo $WERCKER_GIT_COMMIT $(date -u +%s) $(stat -c%s ./$WERCKER_GIT_COMMIT/index.js) $WERCKER_GIT_COMMIT_MESSAGE >> ./index
# move the doc page
mv -f ../doc/dist/* .
# push the changes
git add .
git commit -m $WERCKER_GIT_COMMIT
git push --quiet --set-upstream github gh-pages