2019-10-21 05:44:28 +08:00
|
|
|
name: Deploy
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
2023-07-17 07:40:11 +08:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2023-07-17 08:16:15 +08:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2019-10-21 05:44:28 +08:00
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Deploy Release
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-22 19:28:54 +08:00
|
|
|
target:
|
|
|
|
- aarch64-unknown-linux-musl
|
|
|
|
- x86_64-unknown-linux-gnu
|
|
|
|
- x86_64-unknown-linux-musl
|
|
|
|
- x86_64-apple-darwin
|
|
|
|
- x86_64-pc-windows-msvc
|
|
|
|
include:
|
|
|
|
- target: aarch64-unknown-linux-musl
|
2022-12-15 21:52:15 +08:00
|
|
|
os: ubuntu-20.04
|
2022-07-22 19:28:54 +08:00
|
|
|
- target: x86_64-unknown-linux-gnu
|
2022-12-15 21:52:15 +08:00
|
|
|
os: ubuntu-20.04
|
2022-07-22 19:28:54 +08:00
|
|
|
- target: x86_64-unknown-linux-musl
|
2022-12-15 21:52:15 +08:00
|
|
|
os: ubuntu-20.04
|
2022-07-22 19:28:54 +08:00
|
|
|
- target: x86_64-apple-darwin
|
|
|
|
os: macos-latest
|
|
|
|
- target: x86_64-pc-windows-msvc
|
|
|
|
os: windows-latest
|
2019-10-21 05:44:28 +08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- name: Install Rust
|
2022-07-22 19:28:54 +08:00
|
|
|
run: ci/install-rust.sh stable ${{ matrix.target }}
|
2023-07-17 08:16:15 +08:00
|
|
|
- name: Build asset
|
|
|
|
run: ci/make-release-asset.sh ${{ matrix.os }} ${{ matrix.target }}
|
|
|
|
- name: Update release with new asset
|
2019-10-22 04:41:06 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-07-17 08:16:15 +08:00
|
|
|
run: gh release upload $MDBOOK_TAG $MDBOOK_ASSET
|
2019-10-21 05:44:28 +08:00
|
|
|
pages:
|
|
|
|
name: GitHub Pages
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- name: Install Rust (rustup)
|
|
|
|
run: rustup update stable --no-self-update && rustup default stable
|
2019-10-22 04:41:06 +08:00
|
|
|
- name: Build book
|
2020-09-23 09:16:09 +08:00
|
|
|
run: cargo run -- build guide
|
2019-10-22 04:41:06 +08:00
|
|
|
- name: Deploy to GitHub
|
|
|
|
env:
|
|
|
|
GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }}
|
|
|
|
run: |
|
2020-09-23 09:16:09 +08:00
|
|
|
touch guide/book/.nojekyll
|
2019-10-22 04:41:06 +08:00
|
|
|
curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy
|
2020-09-23 09:16:09 +08:00
|
|
|
cd guide/book
|
2019-10-22 04:41:06 +08:00
|
|
|
/tmp/deploy
|