-
Notifications
You must be signed in to change notification settings - Fork 218
Deploy Website with Github Pages (Related #776) #777
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
08abbb6
Add workflow to build reference and tutorials
ClaasJG 464dfe4
Add job to build Rust API Docs
ClaasJG fc704cb
Add job to build Website
ClaasJG 1b0ba07
Add job to deploy to github pages
ClaasJG 95435dd
Remove netlify
ClaasJG e5a213c
Website: Fix links for deployment in sub folders
ClaasJG f3ffaf4
Website: Remove references
ClaasJG e527fa4
Website: index from parts of README.md
ClaasJG 25f5c61
Fix readme crates io/rs links
ClaasJG b6c2509
Update links to website and repo
ClaasJG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Website | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
RUSTFLAGS: -Cdebuginfo=0 | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
Tutorials: | ||
name: Doc Tutorials | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: docs/tutorials | ||
|
||
- name: Build Books | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: [email protected] | ||
|
||
- run: mdbook build docs/tutorials --dest-dir ${GITHUB_WORKSPACE}/public/docs/tutorials | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: Doc Tutorials | ||
path: public/docs/tutorials | ||
|
||
Rust-API: | ||
name: Doc Rust API | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
components: rust-docs | ||
|
||
- name: Build API Doc | ||
env: | ||
FEATURES: parallel serde derive uuid_entity storage-event-control | ||
run: cargo doc --all --features "${FEATURES}" # --no-deps | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: Doc Rust API | ||
path: | | ||
target/doc | ||
|
||
Website: | ||
name: Doc Website | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
docs/website | ||
|
||
- name: Find Base Url | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Use the API to retrieve the github pages url and set an environment variable containing the value. | ||
run: echo "GITHUB_PAGES_URL=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')" >> $GITHUB_ENV | ||
|
||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: [email protected] | ||
|
||
- run: zola build --base-url $GITHUB_PAGES_URL | ||
working-directory: docs/website | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: Doc Zola | ||
path: docs/website/public | ||
|
||
Deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
needs: [ Tutorials, Rust-API, Website ] | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Doc Tutorials | ||
path: public/docs/tutorials | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Doc Rust API | ||
path: public/docs/api | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Doc Zola | ||
path: public | ||
|
||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: public | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,101 @@ | ||
+++ | ||
paginate_by = 5 | ||
sort_by = "date" | ||
title = "Specs" | ||
template = "section-nodate.html" | ||
+++ | ||
|
||
> **S**pecs **P**arallel **ECS** | ||
|
||
Specs is an Entity-Component System written in Rust. | ||
Unlike most other ECS libraries out there, it provides | ||
|
||
* easy parallelism | ||
* high flexibility | ||
* contains 5 different storages for components, which can be extended by the user | ||
* its types are mostly not coupled, so you can easily write some part yourself and | ||
still use Specs | ||
* `System`s may read from and write to components and resources, can depend on each | ||
other and you can use barriers to force several stages in system execution | ||
* high performance for real-world applications | ||
|
||
## [Link to the book][book] | ||
|
||
[book]: docs/tutorials/ | ||
|
||
## Example | ||
|
||
```rust | ||
use specs::prelude::*; | ||
ClaasJG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// A component contains data | ||
// which is associated with an entity. | ||
#[derive(Debug)] | ||
struct Vel(f32); | ||
|
||
impl Component for Vel { | ||
type Storage = VecStorage<Self>; | ||
} | ||
|
||
#[derive(Debug)] | ||
struct Pos(f32); | ||
|
||
impl Component for Pos { | ||
type Storage = VecStorage<Self>; | ||
} | ||
|
||
struct SysA; | ||
|
||
impl<'a> System<'a> for SysA { | ||
// These are the resources required for execution. | ||
// You can also define a struct and `#[derive(SystemData)]`, | ||
// see the `full` example. | ||
type SystemData = (WriteStorage<'a, Pos>, ReadStorage<'a, Vel>); | ||
|
||
fn run(&mut self, (mut pos, vel): Self::SystemData) { | ||
// The `.join()` combines multiple component storages, | ||
// so we get access to all entities which have | ||
// both a position and a velocity. | ||
for (pos, vel) in (&mut pos, &vel).join() { | ||
pos.0 += vel.0; | ||
} | ||
} | ||
} | ||
|
||
fn main() { | ||
// The `World` is our | ||
// container for components | ||
// and other resources. | ||
let mut world = World::new(); | ||
world.register::<Pos>(); | ||
world.register::<Vel>(); | ||
|
||
// An entity may or may not contain some component. | ||
|
||
world.create_entity().with(Vel(2.0)).with(Pos(0.0)).build(); | ||
world.create_entity().with(Vel(4.0)).with(Pos(1.6)).build(); | ||
world.create_entity().with(Vel(1.5)).with(Pos(5.4)).build(); | ||
|
||
// This entity does not have `Vel`, so it won't be dispatched. | ||
world.create_entity().with(Pos(2.0)).build(); | ||
|
||
// This builds a dispatcher. | ||
// The third parameter of `with` specifies | ||
// logical dependencies on other systems. | ||
// Since we only have one, we don't depend on anything. | ||
// See the `full` example for dependencies. | ||
let mut dispatcher = DispatcherBuilder::new() | ||
.with(SysA, "sys_a", &[]).build(); | ||
// This will call the `setup` function of every system. | ||
// In this example this has no effect | ||
// since we already registered our components. | ||
dispatcher.setup(&mut world); | ||
|
||
// This dispatches all the systems in parallel (but blocking). | ||
dispatcher.dispatch(&mut world); | ||
} | ||
``` | ||
|
||
## Contribution | ||
|
||
Contribution is very welcome! If you didn't contribute before, | ||
just filter for issues with "easy" or "good first issue" label. | ||
Please note that your contributions are assumed to be dual-licensed under Apache-2.0/MIT. |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends "index.html" %} | ||
|
||
{% block content %} | ||
<div class="post"> | ||
<h1 class="post-title">{{ section.title }}</h1> | ||
{{ section.content | safe }} | ||
</div> | ||
{% endblock content %} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.