|
1 | 1 | name: Website |
| 2 | + |
2 | 3 | on: |
3 | 4 | pull_request: {} |
4 | 5 | push: |
5 | 6 | branches: |
6 | 7 | - main |
7 | 8 |
|
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + id-token: write |
| 12 | + pages: write |
| 13 | + |
8 | 14 | concurrency: |
9 | 15 | group: ${{ github.workflow }}-${{ github.ref }} |
10 | 16 | cancel-in-progress: false |
11 | 17 |
|
12 | 18 | jobs: |
13 | | - book-test: |
14 | | - name: Test Book |
15 | | - runs-on: ubuntu-latest |
16 | | - steps: |
17 | | - - uses: actions/checkout@v6 |
18 | | - |
19 | | - - name: Set up Rust toolchain |
20 | | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
21 | | - with: |
22 | | - target: wasm32-unknown-unknown |
23 | | - |
24 | | - - name: Install Cargo Binary Install |
25 | | - uses: cargo-bins/cargo-binstall@main |
26 | | - |
27 | | - - name: Install mdBook |
28 | | - run: cargo binstall --force -y mdbook mdbook-tabs mdbook-trunk |
29 | | - |
30 | | - - name: Run tests |
31 | | - run: mdbook test |
32 | | - working-directory: book |
33 | | - |
34 | | - book-build: |
35 | | - name: Build Book |
36 | | - needs: book-test |
37 | | - runs-on: ubuntu-latest |
38 | | - steps: |
39 | | - - uses: actions/checkout@v6 |
40 | | - with: |
41 | | - fetch-depth: 0 |
42 | | - |
43 | | - - name: Set up Rust toolchain |
44 | | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
45 | | - with: |
46 | | - target: wasm32-unknown-unknown |
47 | | - |
48 | | - - name: Install Cargo Binary Install |
49 | | - uses: cargo-bins/cargo-binstall@main |
50 | | - |
51 | | - - name: Install mdBook and Trunk |
52 | | - run: cargo binstall --force -y mdbook mdbook-tabs mdbook-trunk trunk |
53 | | - |
54 | | - - name: Install Node.js dependencies |
55 | | - run: npm ci |
56 | | - |
57 | | - - name: Build Book |
58 | | - run: mdbook build |
59 | | - working-directory: book |
60 | | - |
61 | | - - name: Combine Book Outputs |
62 | | - run: mdbook-trunk combine |
63 | | - working-directory: book |
64 | | - |
65 | | - - name: Upload artifact |
66 | | - uses: actions/upload-artifact@v7 |
67 | | - with: |
68 | | - name: book |
69 | | - path: book/dist |
70 | | - retention-days: 1 |
71 | | - if-no-files-found: error |
72 | | - |
73 | | - deploy: |
74 | | - name: Deploy |
75 | | - needs: book-build |
76 | | - if: github.ref == 'refs/heads/main' |
77 | | - runs-on: ubuntu-latest |
78 | | - permissions: |
79 | | - contents: read |
80 | | - pages: write |
81 | | - id-token: write |
82 | | - steps: |
83 | | - - uses: actions/checkout@v6 |
84 | | - with: |
85 | | - fetch-depth: 0 |
86 | | - |
87 | | - - name: Download artifacts |
88 | | - uses: actions/download-artifact@v8 |
89 | | - with: |
90 | | - path: dist |
91 | | - merge-multiple: true |
92 | | - |
93 | | - - name: Setup Pages |
94 | | - uses: actions/configure-pages@v6 |
95 | | - |
96 | | - - name: Upload artifact |
97 | | - uses: actions/upload-pages-artifact@v5 |
98 | | - with: |
99 | | - path: dist |
100 | | - |
101 | | - - name: Deploy to GitHub Pages |
102 | | - id: deployment |
103 | | - uses: actions/deploy-pages@v5 |
| 19 | + book: |
| 20 | + name: Book |
| 21 | + uses: RustForWeb/.github/.github/workflows/book.yml@373c25f8fd29e10c40f1343f13312f8be3514af0 |
0 commit comments