-
Notifications
You must be signed in to change notification settings - Fork 68
/
.travis.yml
58 lines (56 loc) · 2.06 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
stages:
- unittest
- exampletest
- name: dockerbuild
if: branch = master
- name: website
if: branch = master AND type != pull_request
- name: restore-helm-repo-index
if: branch = master AND type != pull_request
- name: sourcedocs
if: branch = master AND type != pull_request
.elixir-env: &elixir-env
language: elixir
elixir: "1.11.3"
# available versions https://docs.travis-ci.com/user/languages/erlang/#otprelease-versions
otp_release: "23.2.5"
jobs:
include:
- stage: dockerbuild
language: minimal
services:
- docker
script:
- docker build .
- stage: website
language: node_js
node_js:
- "14"
cache:
yarn: true
script:
- git config --global user.name "${GH_NAME}"
- git config --global user.email "${GH_NAME}@users.noreply.github.com"
- echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
- cd website && yarn install && GIT_USER="${GH_NAME}" yarn run publish-gh-pages
- stage: restore-helm-repo-index
language: minimal
script:
- git config --global user.name "${GH_NAME}"
- git config --global user.email "${GH_NAME}@users.noreply.github.com"
- echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
- git fetch --unshallow
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin
- git checkout gh-pages
- test -e index.yaml || git checkout $(git rev-list -n1 HEAD -- index.yaml)~1 -- index.yaml
- git add index.yaml
- git diff-index --quiet HEAD || git commit -m "Auto-restore Helm chart repo index after Docusaurus publish"
- git push
- stage: sourcedocs
<<: *elixir-env
script:
- git config --global user.name "${GH_NAME}"
- git config --global user.email "${GH_NAME}@users.noreply.github.com"
- echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
- GIT_USER="${GH_NAME}" mix publish_gh_pages