Skip to content

Commit

Permalink
Merge #285
Browse files Browse the repository at this point in the history
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 <adam@adamgreig.com>
  • Loading branch information
bors[bot] and adamgreig committed Mar 8, 2021
2 parents a96d096 + 07a9857 commit 4fe9e2e
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 75 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches: [ staging, trying, master ]
pull_request:

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Install Python dependencies
run: |
pip3 install --user python-dateutil linkchecker
- name: Put pip binary directory into path
run: echo "~/.local/bin" >> $GITHUB_PATH

- name: Cache Cargo installed binaries
uses: actions/cache@v1
id: cache-cargo
with:
path: ~/cargo-bin
key: cache-cargo
- name: Install mdbook
if: steps.cache-cargo.outputs.cache-hit != 'true'
uses: actions-rs/install@v0.1
with:
crate: mdbook
version: latest
- name: Copy mdbook to cache directory
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
mkdir ~/cargo-bin
cp ~/.cargo/bin/mdbook ~/cargo-bin
- name: Put new cargo binary directory into path
run: echo "~/cargo-bin" >> $GITHUB_PATH

- name: Build book
run: mdbook build
- name: Test book
run: mdbook test
- name: Check links
run: linkchecker book

- name: Deploy book
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: book
force_orphan: true
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion CNAME

This file was deleted.

17 changes: 0 additions & 17 deletions ci/after-success.sh

This file was deleted.

18 changes: 0 additions & 18 deletions ci/install.sh

This file was deleted.

19 changes: 0 additions & 19 deletions ci/script.sh

This file was deleted.

0 comments on commit 4fe9e2e

Please sign in to comment.