|
1 | | -# Simple workflow for deploying static content to GitHub Pages |
2 | | -name: Deploy static content to Pages |
| 1 | +name: Deploy to GitHub Pages |
3 | 2 |
|
4 | 3 | on: |
5 | | - # Runs on main when a release is published |
6 | | - release: |
7 | | - types: [published] |
8 | | - branches: ["main"] |
9 | 4 | push: |
10 | | - branches: ["main"] |
11 | | - |
12 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
13 | | -permissions: |
14 | | - contents: read |
15 | | - pages: write |
16 | | - id-token: write |
17 | | - |
18 | | -concurrency: |
19 | | - group: "pages" |
20 | | - cancel-in-progress: false |
| 5 | + branches: |
| 6 | + - main |
21 | 7 |
|
22 | 8 | jobs: |
23 | | - # Single deploy job since we're just deploying |
24 | | - deploy: |
25 | | - environment: |
26 | | - name: github-pages |
27 | | - url: ${{ steps.deployment.outputs.page_url }} |
| 9 | + build: |
28 | 10 | runs-on: ubuntu-latest |
| 11 | + |
29 | 12 | steps: |
30 | 13 | - name: Checkout repository |
31 | | - uses: actions/checkout@v4 |
| 14 | + uses: actions/checkout@v2 |
| 15 | + |
32 | 16 | - name: Set up Rust |
33 | 17 | uses: actions-rs/toolchain@v1 |
34 | 18 | with: |
35 | 19 | toolchain: stable |
| 20 | + override: true |
| 21 | + |
36 | 22 | - name: Build the project |
37 | 23 | run: cargo build --release --target wasm32-unknown-unknown |
38 | | - - name: Install wasm-bindgen-cli |
39 | | - run: cargo install wasm-bindgen-cli |
40 | | - - name: Generate wasm-bindgen output |
41 | | - run: wasm-bindgen target/wasm32-unknown-unknown/release/random_shader_window.wasm --out-dir ./out --web |
42 | | - - name: Copy index.html to deploy directory |
43 | | - run: cp index.html ./out |
44 | | - - name: Setup Pages |
45 | | - uses: actions/configure-pages@v4 |
46 | | - - name: Upload artifact |
47 | | - uses: actions/upload-pages-artifact@v3 |
| 24 | + |
| 25 | + - name: Upload artifacts |
| 26 | + uses: actions/upload-artifact@v2 |
48 | 27 | with: |
49 | | - # Upload entire repository |
50 | | - path: ./out |
| 28 | + name: wasm-build |
| 29 | + path: pkg |
| 30 | + |
| 31 | + deploy: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + needs: build |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Checkout repository |
| 37 | + uses: actions/checkout@v2 |
| 38 | + |
| 39 | + - name: Download artifacts |
| 40 | + uses: actions/download-artifact@v2 |
| 41 | + with: |
| 42 | + name: wasm-build |
| 43 | + path: pkg |
| 44 | + |
51 | 45 | - name: Deploy to GitHub Pages |
52 | | - id: deployment |
53 | | - uses: actions/deploy-pages@v4 |
| 46 | + uses: peaceiris/actions-gh-pages@v3 |
| 47 | + with: |
| 48 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + publish_dir: ./pkg |
0 commit comments