Skip to content

Add index page for the gh-pages #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged

Add index page for the gh-pages #5

merged 2 commits into from
Mar 6, 2025

Conversation

qa-chrisb
Copy link
Owner

@qa-chrisb qa-chrisb commented Mar 6, 2025

Add GitHub Actions workflow for deploying to GitHub Pages and update project for WebAssembly.

  • GitHub Actions Workflow

    • Create .github/workflows/deploy-gh-pages.yml to deploy static content to GitHub Pages on push to main branch.
    • Add steps to check out the repository, set up Rust, build the project, install wasm-bindgen-cli, generate wasm-bindgen output, copy index.html to deploy directory, set up Pages, upload artifact, and deploy to GitHub Pages.
  • Project Configuration

    • Modify Cargo.toml to add dependencies for wasm-bindgen and wasm-server-runner.
  • Main Function

    • Modify src/main.rs to add wasm_bindgen::prelude::* to imports.
    • Add #[wasm_bindgen(start)] attribute to the main function.
  • Index Page

    • Add index.html to load the WebAssembly module and generated JavaScript glue code.

For more details, open the Copilot Workspace session.

Add GitHub Actions workflow for deploying to GitHub Pages and update project for WebAssembly.

* **GitHub Actions Workflow**
  - Create `.github/workflows/deploy-gh-pages.yml` to deploy static content to GitHub Pages on push to `main` branch.
  - Add steps to check out the repository, set up Rust, build the project, install `wasm-bindgen-cli`, generate `wasm-bindgen` output, copy `index.html` to deploy directory, set up Pages, upload artifact, and deploy to GitHub Pages.

* **Project Configuration**
  - Modify `Cargo.toml` to add dependencies for `wasm-bindgen` and `wasm-server-runner`.

* **Main Function**
  - Modify `src/main.rs` to add `wasm_bindgen::prelude::*` to imports.
  - Add `#[wasm_bindgen(start)]` attribute to the `main` function.

* **Index Page**
  - Add `index.html` to load the WebAssembly module and generated JavaScript glue code.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/cabrownlie/random-shader-window?shareId=XXXX-XXXX-XXXX-XXXX).
* **Build job**
  - Check out the repository
  - Set up Rust toolchain
  - Build the project for the `wasm32-unknown-unknown` target
  - Upload build artifacts

* **Deploy job**
  - Depend on the `build` job
  - Check out the repository
  - Download build artifacts
  - Deploy to GitHub Pages using `peaceiris/actions-gh-pages@v3`
@qa-chrisb qa-chrisb merged commit 0ef02b6 into main Mar 6, 2025
1 check passed
@qa-chrisb qa-chrisb deleted the add-gh-pages-index branch March 6, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant