forked from LightJason/lightjason.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircle.yml
More file actions
61 lines (54 loc) · 2.44 KB
/
Copy pathcircle.yml
File metadata and controls
61 lines (54 loc) · 2.44 KB
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
58
59
60
61
general:
branches:
only:
- developing
ignore:
- master
- /dev-.*/
machine:
timezone:
Europe/Berlin
environment:
GIT_AUTHOR_NAME: CircleCI
GIT_AUTHOR_EMAIL: info@lightjason.org
GIT_COMMITTER_NAME: CircleCI
GIT_COMMITTER_EMAIL: info@lightjason.org
dependencies:
pre:
- sudo apt-get install zsh
# see release version https://github.com/spf13/hugo/releases
- wget -O hugo.deb https://github.com/spf13/hugo/releases/download/v0.18.1/hugo_0.18.1-64bit.deb
- sudo dpkg -i hugo.deb
# see release version https://github.com/yui/yuicompressor/releases
- wget -O yuicompressor.jar https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar
# see relese version https://github.com/nodesource/distributions
- "curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash"
- sudo apt-get install -y nodejs
# see release version https://github.com/kangax/html-minifier
- npm install -g html-minifier
# see release version https://github.com/svg/svgo
- npm install -g git+https://github.com/svg/svgo.git
test:
override:
- hugo
post:
- svgo --config=data/svgo.config public/images/
- find public -type f -name "*.css" -exec java -jar yuicompressor.jar -o \{\} \{\} \;
- find public -type f -name "*.js" -exec java -jar yuicompressor.jar -o \{\} \{\} \;
- find public -type f -name "*.htm*" -exec data/minifyhtml.sh \{\} \;
- mv -f public /tmp
deployment:
production:
branch: developing
commands:
- git push origin :master || true
- git brach -D master || true
- git checkout --orphan master
- rm -Rf *
- mv -f /tmp/public/* .
- echo -e 'general:\n branches:\n ignore:\n - master\n' > circle.yml
- echo -e '*.*\n!.gitignore\n!circle.yml\n!*.html\n!*.xml\n!*.css\n!*.js\n!*.json\n!*.bib\n!*.zip\n!*.png\n!*.gif\n!*.pdf\n!*.svg\n!*.txt\n' > .gitignore
- echo -e '# LightJason\n\nCurrent website of the [LightJason](http://lightjason.org) project' > readme.md
- git add --all .
- export GIT_COMMIT_MESSAGE="$(git show -s --pretty=format:%s $CIRCLE_SHA1)" && git commit -m "webpage update [$GIT_COMMIT_MESSAGE]"
- git push origin master