This repository has been archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
64 lines (55 loc) · 1.73 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
language: python
python:
- 3.7
node_js:
- 12.16.3
cache: npm
git:
depth: false
install:
- npm ci
- pip install -r requirements.txt
before_script:
# Git setup
- echo This works before script
- git checkout "${TRAVIS_BRANCH}"
- git config --global user.email "travis@travis-ci.com"
- git config --global user.name "Travis CI"
jobs:
include:
- stage: Build and Push to Github Pages
script:
# Custom tests and preprocessing
- sh utils/github.io_fix.sh # This changes URLs for github.io
- npm run build
# Add new "origin" with access token in the git URL for authentication
- git add src/citations/cache.yml
- 'git commit -m "Travis: Build and deploy to Github" -m "[skip ci]" || echo "No changes to commit"'
deploy:
skip-cleanup: true
provider: pages
github-token: $GITHUB_TOKEN
local_dir: dist
on:
branch: master
- stage: Build and Deploy to iGEM
if: commit_message =~ /iGEM-deploy/
script:
- npm run build
# Push to iGEM
- pip install igem-wikisync
- python wikisync.py
# Print upload map in case pushing back to Github doesn't work
- cat upload_map.yml
- git add upload_map.yml wikisync.log dist igem
- 'git commit -m "Travis: Build and deploy to iGEM" -m "[skip ci]"'
after_script:
# Add new "origin" with access token in the git URL for authentication
- echo This works after script
- git remote rm origin
- git remote add origin https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git > /dev/null 2>&1
- git push origin "${TRAVIS_BRANCH}" -f
notifications:
email:
on_success: never
on_failure: always