forked from heckj/swiftui-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
52 lines (44 loc) · 2.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
sudo: required
# huge thanks to http://mgreau.com/posts/2016/03/28/asciidoc-to-gh-pages-with-travis-ci-docker-asciidoctor.html
services:
- docker
before_install:
- mkdir -p output
- docker pull heckj/docker-asciidoctor
# using instead of asciidoctor/docker-asciidoctor because I added rugged to support git metadata
stages:
- render
- name: deploy
if: branch = master AND type NOT IN (pull_request)
jobs:
include:
- stage: render
script:
- # docker run --rm -i -v $TRAVIS_BUILD_DIR/marbles/diagrams:/data --name rxmarbles heckj/rxmarbles
- # cp $TRAVIS_BUILD_DIR/marbles/diagrams/*.svg $TRAVIS_BUILD_DIR/docs/images/diagrams/
- docker run -v $TRAVIS_BUILD_DIR:/documents/ --name asciidoc-to-html heckj/docker-asciidoctor asciidoctor -v -t -D /documents/output -r ./docs/lib/google-analytics-docinfoprocessor.rb -r ./docs/lib/git-metadata-preprocessor/extension.rb docs/using-combine-book.adoc
- docker run -v $TRAVIS_BUILD_DIR:/documents/ --name asciidoc-to-pdf heckj/docker-asciidoctor asciidoctor-pdf -v -t -D /documents/output docs/using-combine-book.adoc
- docker run -v $TRAVIS_BUILD_DIR:/documents/ --name asciidoc-to-epub3 heckj/docker-asciidoctor asciidoctor-epub3 -v -t -D /documents/output docs/using-combine-book.adoc
- stage: deploy
script:
- # docker run --rm -i -v $TRAVIS_BUILD_DIR/marbles/diagrams:/data --name rxmarbles heckj/rxmarbles
- # cp $TRAVIS_BUILD_DIR/marbles/diagrams/*.svg $TRAVIS_BUILD_DIR/docs/images/diagrams/
- docker run -v $TRAVIS_BUILD_DIR:/documents/ --name asciidoc-to-html heckj/docker-asciidoctor asciidoctor -v -t -D /documents/output -r ./docs/lib/google-analytics-docinfoprocessor.rb -r ./docs/lib/git-metadata-preprocessor/extension.rb docs/using-combine-book.adoc
- docker run -v $TRAVIS_BUILD_DIR:/documents/ --name asciidoc-to-pdf heckj/docker-asciidoctor asciidoctor-pdf -v -t -D /documents/output docs/using-combine-book.adoc
- docker run -v $TRAVIS_BUILD_DIR:/documents/ --name asciidoc-to-epub3 heckj/docker-asciidoctor asciidoctor-epub3 -v -t -D /documents/output docs/using-combine-book.adoc
- cd output ; mv using-combine-book.html index.html ; cp -R ../docs/images images
- git init
- git config user.name "${GH_USER_NAME}"
- git config user.email "{GH_USER_EMAIL}"
- git add . ; git commit -m "Deploying to GitHub Pages"
- git push --force "https://${GH_TOKEN}@github.com/heckj/swiftui-notes.git" master:gh-pages
after_error:
- # docker logs rxmarbles
- docker logs asciidoc-to-html
- docker logs asciidoc-to-pdf
- docker logs asciidoc-to-epub3
after_failure:
- # docker logs rxmarbles
- docker logs asciidoc-to-html
- docker logs asciidoc-to-pdf
- docker logs asciidoc-to-epub3