File: deploy.yml

package info (click to toggle)
mdbook 0.4.52%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,376 kB
  • sloc: javascript: 1,140; sh: 75; python: 28; makefile: 26
file content (69 lines) | stat: -rw-r--r-- 2,079 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy
on:
  release:
    types: [created]

defaults:
  run:
    shell: bash

permissions:
  contents: write

jobs:
  release:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - target: aarch64-unknown-linux-musl
            os: ubuntu-22.04
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-22.04
          - target: x86_64-unknown-linux-musl
            os: ubuntu-22.04
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: aarch64-apple-darwin
            os: macos-latest
          - target: x86_64-pc-windows-msvc
            os: windows-latest
    name: Deploy ${{ matrix.target }}
    steps:
    - uses: actions/checkout@v4
    - 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
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: gh release upload $MDBOOK_TAG $MDBOOK_ASSET
  pages:
    name: GitHub Pages
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Install Rust (rustup)
      run: rustup update stable --no-self-update && rustup default stable
    - name: Build book
      run: cargo run -- build guide
    - name: Deploy the User Guide to GitHub Pages using the gh-pages branch
      env:
        GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }}
      run: |
        touch guide/book/.nojekyll
        curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy
        cd guide/book
        /tmp/deploy
  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    steps:
      - 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