|
| 1 | +on: |
| 2 | + workflow_dispatch: |
| 3 | + |
| 4 | +name: Deploy |
| 5 | + |
| 6 | +jobs: |
| 7 | + deploy: |
| 8 | + name: Build WASM & website |
| 9 | + runs-on: ubuntu-latest |
| 10 | + permissions: |
| 11 | + contents: write |
| 12 | + steps: |
| 13 | + - name: Checkout sources |
| 14 | + uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + repository: hyperquark/hyperquark |
| 17 | + |
| 18 | + - name: Install nightly toolchain |
| 19 | + uses: actions-rs/toolchain@v1 |
| 20 | + with: |
| 21 | + profile: minimal |
| 22 | + toolchain: nightly |
| 23 | + override: true |
| 24 | + target: wasm32-unknown-unknown |
| 25 | + |
| 26 | + - name: Install wasm-bindgen |
| 27 | + uses: actions-rs/cargo@v1 |
| 28 | + with: |
| 29 | + command: install |
| 30 | + args: -f wasm-bindgen-cli |
| 31 | + |
| 32 | + - name: Install cargo-outdir |
| 33 | + uses: actions-rs/cargo@v1 |
| 34 | + with: |
| 35 | + command: install |
| 36 | + args: cargo-outdir |
| 37 | + |
| 38 | + - name: Install node |
| 39 | + uses: actions/setup-node@v3 |
| 40 | + with: |
| 41 | + node-version: "20.x" |
| 42 | + |
| 43 | + - name: Run npm install |
| 44 | + run: | |
| 45 | + npm install |
| 46 | + npm i -g vite |
| 47 | + npm i -g binaryen@nightly |
| 48 | + |
| 49 | + - name: Build |
| 50 | + env: |
| 51 | + VITE_HASH_HISTORY: false |
| 52 | + NODE_ENV: production |
| 53 | + run: | |
| 54 | + chmod +x build.sh && ./build.sh -Wpz |
| 55 | + vite build --base=/ |
| 56 | + |
| 57 | + - name: Move files to tmp |
| 58 | + run: mv ./playground/dist /tmp/hq-dist |
| 59 | + |
| 60 | + - name: checkout website repo |
| 61 | + uses: actions/checkout@v4 |
| 62 | + with: |
| 63 | + path: website |
| 64 | + |
| 65 | + - name: move file to website repo |
| 66 | + run: | |
| 67 | + mv $GITHUB_WORKSPACE/website/google*.html /tmp/hq-dist/ |
| 68 | + mv $GITHUB_WORKSPACE/website/.github /tmp/hq-dist/.github |
| 69 | + rm -rf $GITHUB_WORKSPACE/website |
| 70 | + mv /tmp/hq-dist $GITHUB_WORKSPACE/website |
| 71 | + |
| 72 | + - name: Commit changes |
| 73 | + uses: stefanzweifel/git-auto-commit-action@v5 |
| 74 | + with: |
| 75 | + repository: website |
| 76 | + commit_message: Build website |
0 commit comments