forked from yaqwsx/jlcparts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
32 lines (28 loc) · 1.16 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
sudo: required
dist: bionic # To deal with docker & statx syscall
services:
- docker
env: SH="docker exec -t container bash -c"
before_install:
- docker run -d --name container -v $(pwd):/travis -w /travis yaqwsx/jlcparts tail -f /dev/null
- docker ps
install:
- $SH "pip3 install -e ."
- $SH "cd web && npm install"
script:
- $SH "export NODE_ENV=production && cd web && npm run build"
- $SH "wget https://yaqwsx.github.io/jlcparts/data/cache.zip && unzip cache.zip && head -c 160 cache.json"
- $SH "wget -O parts.xls https://jlcpcb.com/componentSearch/uploadComponentInfo"
- $SH "libreoffice --headless --convert-to csv --infilter=CSV:44,34,76,1 parts.xls && head parts.csv"
- $SH "jlcparts getlibrary --cache cache.json --age 1000 parts.csv jlcdata.json && cp jlcdata.json cache.json"
- $SH "jlcparts buildtables jlcdata.json web/build/data"
- $SH "zip web/build/data/cache.zip cache.json"
- $SH "if [ $TRAVIS_REPO_SLUG = 'yaqwsx/jlcparts-dev' ] ; then echo 'jlcparts-dev.honzamrazek.cz' > web/build/CNAME; fi"
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local-dir: web/build
keep_history: false
on:
branch: master