mdBook/.github/workflows/deploy.yml

68 lines
1.9 KiB
YAML
Raw Normal View History

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