add debug info to webapp output #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Webapp to GitHub Pages | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| verify_and_build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: webapp/package-lock.json | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install wasm-pack | |
| uses: taiki-e/install-action@wasm-pack | |
| - name: Install webapp dependencies | |
| working-directory: ./webapp | |
| run: npm ci | |
| - name: Run Rust tests | |
| run: cargo test --release --tests | |
| - name: Run webapp tests | |
| working-directory: ./webapp | |
| run: node --test tests/ballot_config.test.mjs | |
| - name: Check wasm target build | |
| run: cargo check --target wasm32-unknown-unknown | |
| - name: Build WASM package | |
| run: wasm-pack build --target web --release | |
| - name: Build webapp | |
| working-directory: ./webapp | |
| run: npm run build -- --base=./ | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./webapp/dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: verify_and_build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |