forked from hpi-schul-cloud/nuxt-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (91 loc) · 2.79 KB
/
.travis.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
branches:
only:
- develop
- master
- /^(?i:release|hotfix).*$/
language: node_js
node_js:
- lts/*
dist: xenial
git:
submodules: false
env:
global:
- TZ=Europe/Berlin
- GIT_SHA=$( git rev-parse HEAD )
- DOCKERTAG="$( echo $TRAVIS_BRANCH | tr -s '[:punct:]' '-' | tr -s '[:upper:]' '[:lower:]' )_v$( jq -r '.version' package.json )_$TRAVIS_COMMIT"
# do not run on develop if it is just a dependency update from dependabot to preserve resources
# "not type = pull_request" is required to keep it running on PRs
if: not (branch = develop and commit_message ~= /^Bump.*from.*to.*$/ and not type = pull_request)
stages:
- test
- name: build
if: type = push && (branch = master || branch = develop || branch ~= /^(?i:release|hotfix).*$/)
- name: deploy
if: type = push && (branch = master || branch = develop || branch ~= /^(?i:release|hotfix).*$/)
jobs:
include:
# Build
- stage: test
script: npm run build:nuxt
name: "build:nuxt:default"
- script: npm run build:nuxt
name: "build:nuxt:brb"
env:
- SC_THEME=brb
- script: npm run build:nuxt
name: "build:nuxt:n21"
env:
- SC_THEME=n21
- script: npm run build:nuxt
name: "build:nuxt:open"
env:
- SC_THEME=open
- script: npm run build:nuxt
name: "build:nuxt:thr"
env:
- SC_THEME=thr
- script: npm run build:nuxt
name: "build:nuxt:int"
env:
- SC_THEME=int
- script: npm run build:storybook
name: "build:storybook"
after_success:
- npm i -g surge
- bash ./deploy/pull-deploy.sh -p storybook
- script: npm run build:docs
name: "build:docs"
after_success:
- npm i -g surge
- bash ./deploy/pull-deploy.sh -p vuepress
# Build Docker Images
- stage: build
name: build:nuxt
language: generic
script: bash ./deploy/build.sh -p client
- script: bash ./deploy/build.sh -p storybook
name: build:storybook
language: generic
- script: bash ./deploy/build.sh -p vuepress
name: build:docs
language: generic
# Deploy
- stage: deploy
name: deploy:nuxt
language: generic
script: bash ./deploy/deploy.sh -p client
- script: skip
name: deploy:storybook
language: generic
script: bash ./deploy/deploy.sh -p storybook
- script: skip
name: deploy:docs
language: generic
script: bash ./deploy/deploy.sh -p vuepress
cache: npm
before_cache:
# delete all .cache folders before actually storing the cache.
# nuxt, storybook and vuepress stores some build artefacts here which invalidates the cache.
- cd node_modules && find . -name .cache -type d -exec rm -rf {} + && cd ..
- cd node_modules && find . -name .temp -type d -exec rm -rf {} + && cd ..