Skip to content

Commit 9552737

Browse files
committed
Add CI
1 parent d41ecc5 commit 9552737

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
name: Test
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@main
10+
- name: Update rustup
11+
run: rustup self update
12+
- name: Install Rust
13+
run: |
14+
rustup set profile minimal
15+
rustup toolchain install nightly -c rust-docs
16+
rustup default nightly
17+
- name: Install mdbook
18+
run: |
19+
mkdir bin
20+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.15/mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
21+
echo "$(pwd)/bin" >> ${GITHUB_PATH}
22+
echo "$(pwd)/bin" >> $GITHUB_PATH
23+
- name: Report versions
24+
run: |
25+
rustup --version
26+
rustc -Vv
27+
mdbook --version
28+
- name: Run tests
29+
run: mdbook test
30+
- name: Build HTML
31+
run: mdbook build
32+
33+
deploy:
34+
if: ${{ github.ref == 'refs/heads/master' }}
35+
name: Deploy
36+
runs-on: ubuntu-latest
37+
needs: test
38+
steps:
39+
- name: Deploy to server
40+
uses: appleboy/ssh-action@master
41+
with:
42+
host: ${{ secrets.SSH_HOST }}
43+
username: ${{ secrets.SSH_USERNAME }}
44+
key: ${{ secrets.SSH_KEY }}
45+
port: ${{ secrets.SSH_PORT }}
46+
script: |
47+
./tools/rust-deploy/update-cn.sh >/dev/null 2>&1

0 commit comments

Comments
 (0)