|
11 | 11 | # workflow_run:
|
12 | 12 | # workflows: [Continuous integration]
|
13 | 13 | # types: [completed]
|
14 |
| - # branches: [main] |
| 14 | + # branches: [main] |
15 | 15 |
|
16 | 16 | jobs:
|
17 | 17 | release:
|
18 | 18 | runs-on: ubuntu-latest
|
19 | 19 | steps:
|
20 | 20 | # Checkout the repository
|
21 | 21 | - uses: actions/checkout@v2
|
| 22 | + |
22 | 23 | # Install the stable toolchain for Rust and target WASM
|
23 | 24 | - uses: actions-rs/toolchain@v1
|
24 | 25 | with:
|
25 | 26 | toolchain: stable
|
26 | 27 | target: wasm32-unknown-unknown
|
27 |
| - - name: Rust Cache #cache build artifacts |
| 28 | + |
| 29 | + # Cache Rust build artifacts |
| 30 | + - name: Rust Cache |
28 | 31 | uses: Swatinem/rust-cache@v1
|
| 32 | + |
29 | 33 | # Build the WASM with trunk
|
30 |
| - - uses: jetli/trunk-action@v0.1.0 |
| 34 | + - name: Build with Trunk |
| 35 | + run: ./trunk build --release --public-url $public_url |
| 36 | + env: |
| 37 | + public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" |
| 38 | + |
31 | 39 | # Use wasm-bindgen to prepare the bindings
|
32 | 40 | - uses: jetli/wasm-bindgen-action@v0.1.0
|
| 41 | + |
33 | 42 | # Build the project in release mode
|
34 |
| - - run: trunk build --release |
35 |
| - # Deploy to GitHub Pages using the gh-pages branch |
36 |
| - - uses: peaceiris/actions-gh-pages@v3 |
| 43 | + - name: Build |
| 44 | + run: ./trunk build --release --public-url $public_url |
| 45 | + env: |
| 46 | + public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" |
| 47 | + |
| 48 | + # Deploy to GitHub Pages |
| 49 | + - name: Deploy |
| 50 | + uses: JamesIves/github-pages-deploy-action@v4 |
37 | 51 | with:
|
38 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
39 |
| - publish_branch: gh-pages |
40 |
| - publish_dir: ./dist |
| 52 | + folder: dist |
| 53 | + # This option will not maintain any history of your previous pages deployment |
| 54 | + # Set to false if you want all page builds to be committed to your gh-pages branch history |
| 55 | + single-commit: true |
0 commit comments