diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..2a8a737 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,25 @@ +name: Build and Deploy +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + build-and-deploy: + concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: oven-sh/setup-bun@v1 + - run: cargo fmt --all -- --check + - run: cargo install wasm-pack + - run: wasm-pack build + - run: cd example && bun install && bun run build && cd .. + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: example/dist diff --git a/example/.gitignore b/example/.gitignore index d515d6d..89199bc 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -5,4 +5,7 @@ node_modules package-lock.json yarn.lock pnpm-lock.yaml -!bun.lockb \ No newline at end of file +!bun.lockb + +# Output +dist \ No newline at end of file diff --git a/example/package.json b/example/package.json index 37a784a..e35645f 100644 --- a/example/package.json +++ b/example/package.json @@ -5,7 +5,8 @@ "scripts": { "dev:vite": "vite", "dev:wasm": "cd .. && cargo watch -i \".gitignore\" -i \"pkg/*\" -i \"example/*\" -s \"wasm-pack build\" -s \"cd example && bun install\"", - "dev": "concurrently \"bun dev:wasm\" \"bun dev:vite\"" + "dev": "concurrently \"bun dev:wasm\" \"bun dev:vite\"", + "build": "vite build" }, "dependencies": { "@scuderia-fe/docx-to-html": "file:../pkg"