Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (51 sloc) 1.77 KB
version: 2
jobs:
build:
docker:
- image: kokuyouwind/review-graph
environment:
REVIEWDOG_VERSION: 0.9.8
steps:
- checkout
- restore_cache:
keys:
- node_modules_{{ arch }}_{{ checksum "yarn.lock" }}
- run:
name: yarn install
command: "yarn install --pure-lockfile"
- run:
name: install reviewdog
command: "curl -fSL https://github.com/haya14busa/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 -o reviewdog && chmod +x ./reviewdog"
- run:
name: lint
command: "$(npm bin)/textlint -f checkstyle src/*.re | tee check_result"
- run:
name: reviewdog
command: >
if [ -n "$REVIEWDOG_GITHUB_API_TOKEN" ]; then
cat check_result | ./reviewdog -f=checkstyle -name=textlint -ci=circle-ci
fi
when: on_fail
- run:
name: build artifacts
command: "cd src && review-pdfmaker config.yml && review-epubmaker config.yml && review-webmaker config.yml"
- store_artifacts:
path: src/book.pdf
destination: book.pdf
- store_artifacts:
path: src/book.epub
destination: book.epub
- store_artifacts:
path: src/webroot
destination: html
- run:
name: upload dropbox
command: >
if [ "$CIRCLE_BRANCH" = "master" -a -n "$DROPBOX_TOKEN" ]; then
mv src/book.pdf src/${CIRCLE_PROJECT_REPONAME}.pdf
sh bin/upload_dropbox.sh ./src/${CIRCLE_PROJECT_REPONAME}.pdf ${DROPBOX_TOKEN}
fi
- save_cache:
key: node_modules_{{ arch }}_{{ checksum "yarn.lock" }}
paths:
- node_modules