From a6183c57ed47b0aa99d2cd92fd9c84e2a114c467 Mon Sep 17 00:00:00 2001 From: KaiserY Date: Wed, 7 Jul 2021 11:09:42 +0800 Subject: [PATCH] add github actions --- .github/workflows/main.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..39b9ddd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,43 @@ +name: CI +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Update rustup + run: rustup self update + - name: Install Rust + run: | + rustup set profile minimal + rustup toolchain install 1.52 -c rust-docs + rustup default 1.52 + - name: Install mdbook + run: | + mkdir bin + curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin + echo "$(pwd)/bin" >> ${GITHUB_PATH} + - name: Report versions + run: | + rustup --version + rustc -Vv + mdbook --version + - name: Run mdBook Build + run: mdbook build + - name: Deploy gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book + force_orphan: true + enable_jekyll: true \ No newline at end of file