name: Deploy EVTX Viewer to GitHub Pages
on:
push:
branches: [ wasm-viewer ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Set up Rust toolchain (stable) with wasm target
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install & cache wasm-pack
uses: jetli/wasm-pack-action@v0.4.0
with:
version: v0.13.1
- name: Build evtx-wasm crate (release)
run: |
wasm-pack build evtx-wasm \
--target web \
--out-dir evtx-viewer/src/wasm \
--out-name evtx_wasm \
--release
- name: Install JS/TS dependencies
working-directory: evtx-wasm/evtx-viewer
run: bun install --frozen-lockfile
- name: Add sample EVTX to viewer public folder
run: |
mkdir -p evtx-wasm/evtx-viewer/public/samples
cp samples/security.evtx evtx-wasm/evtx-viewer/public/samples/
- name: Build viewer
working-directory: evtx-wasm/evtx-viewer
run: bun run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: evtx-wasm/evtx-viewer/dist
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4