Skip to content

Commit 4fe9e2e

Browse files
bors[bot]adamgreig
andauthored
Merge #285
285: Swap to GHA r=therealprof a=adamgreig First go at GHA. I think the other books will be significantly harder due to more extensive CI, so this one first seems like a good starting point. 🤞 Co-authored-by: Adam Greig <[email protected]>
2 parents a96d096 + 07a9857 commit 4fe9e2e

File tree

6 files changed

+57
-75
lines changed

6 files changed

+57
-75
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ staging, trying, master ]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions-rs/toolchain@v1
14+
with:
15+
profile: minimal
16+
toolchain: stable
17+
18+
- name: Install Python dependencies
19+
run: |
20+
pip3 install --user python-dateutil linkchecker
21+
- name: Put pip binary directory into path
22+
run: echo "~/.local/bin" >> $GITHUB_PATH
23+
24+
- name: Cache Cargo installed binaries
25+
uses: actions/cache@v1
26+
id: cache-cargo
27+
with:
28+
path: ~/cargo-bin
29+
key: cache-cargo
30+
- name: Install mdbook
31+
if: steps.cache-cargo.outputs.cache-hit != 'true'
32+
uses: actions-rs/[email protected]
33+
with:
34+
crate: mdbook
35+
version: latest
36+
- name: Copy mdbook to cache directory
37+
if: steps.cache-cargo.outputs.cache-hit != 'true'
38+
run: |
39+
mkdir ~/cargo-bin
40+
cp ~/.cargo/bin/mdbook ~/cargo-bin
41+
- name: Put new cargo binary directory into path
42+
run: echo "~/cargo-bin" >> $GITHUB_PATH
43+
44+
- name: Build book
45+
run: mdbook build
46+
- name: Test book
47+
run: mdbook test
48+
- name: Check links
49+
run: linkchecker book
50+
51+
- name: Deploy book
52+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
53+
uses: peaceiris/actions-gh-pages@v3
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
publish_dir: book
57+
force_orphan: true

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

ci/after-success.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

ci/install.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

ci/script.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)