diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml new file mode 100644 index 0000000..f8e91d5 --- /dev/null +++ b/.github/workflows/web.yml @@ -0,0 +1,93 @@ +# Workflow to build your docs with oranda (and mdbook) +# and deploy them to Github Pages +name: Web + +# We're going to push to the gh-pages branch, so we need that permission +permissions: + contents: write + +# What situations do we want to build docs in? +# All of these work independently and can be removed / commented out +# if you don't want oranda/mdbook running in that situation +on: + # Check that a PR didn't break docs! + # + # Note that the "Deploy to Github Pages" step won't run in this mode, + # so this won't have any side-effects. But it will tell you if a PR + # completely broke oranda/mdbook. Sadly we don't provide previews (yet)! + pull_request: + + # Whenever something gets pushed to main, update the docs! + # This is great for getting docs changes live without cutting a full release. + # + # Note that if you're using cargo-dist, this will "race" the Release workflow + # that actually builds the Github Release that oranda tries to read (and + # this will almost certainly complete first). As a result you will publish + # docs for the latest commit but the oranda landing page won't know about + # the latest release. The workflow_run trigger below will properly wait for + # cargo-dist, and so this half-published state will only last for ~10 minutes. + # + # If you only want docs to update with releases, disable this, or change it to + # a "release" branch. You can, of course, also manually trigger a workflow run + # when you want the docs to update. + push: + branches: + - main + + # Whenever a workflow called "Release" completes, update the docs! + # + # If you're using cargo-dist, this is recommended, as it will ensure that + # oranda always sees the latest release right when it's available. Note + # however that Github's UI is wonky when you use workflow_run, and won't + # show this workflow as part of any commit. You have to go to the "actions" + # tab for your repo to see this one running (the gh-pages deploy will also + # only show up there). + workflow_run: + workflows: ["Release"] + types: + - completed + +# Alright, let's do it! +jobs: + web: + name: Build and deploy site and docs + runs-on: ubuntu-latest + steps: + # Setup + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: dtolnay/rust-toolchain@stable + - uses: swatinem/rust-cache@v2 + + # If you use any mdbook plugins, here's the place to install them! + + # Install and run oranda (and mdbook)! + # + # This will write all output to ./public/ (including copying mdbook's output to there). + - name: Install and run oranda + run: | + curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/download/v0.6.1/oranda-installer.sh | sh + oranda build + + - name: Add demo git + run: | + cp demo.gif public/demo.gif + + # Deploy to our gh-pages branch (creating it if it doesn't exist). + # The "public" dir that oranda made above will become the root dir + # of this branch. + # + # Note that once the gh-pages branch exists, you must + # go into repo's settings > pages and set "deploy from branch: gh-pages". + # The other defaults work fine. + - name: Deploy to Github Pages + uses: JamesIves/github-pages-deploy-action@v4.4.1 + # ONLY if we're on main (so no PRs or feature branches allowed!) + if: ${{ github.ref == 'refs/heads/main' }} + with: + branch: gh-pages + # Gotta tell the action where to find oranda's output + folder: public + token: ${{ secrets.GITHUB_TOKEN }} + single-commit: true diff --git a/.gitignore b/.gitignore index 06ae0f1..14de248 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ target/ *.pdb .cargo vendor + +# Generated by `oranda generate ci` +public/ \ No newline at end of file diff --git a/README.md b/README.md index 7d13332..9d9227a 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,30 @@ -

wr

-
- - A Rust workshop runner - +
+

wr

+
+ + A Rust workshop runner + +
+ +
+ + + Crates.io version + + + + Download + +

![demo](demo.gif) -`wr` is a CLI to drive test-driven workshops written in Rust. +`wr` is a CLI to drive test-driven workshops written in Rust. It is designed to be used in conjunction with a workshop repository, which contains a series of exercises to be solved by the workshop participants. @@ -25,7 +40,7 @@ by the workshop participants. > > Richard Feynman -A test-driven workshop is structured as a series of exercises. +A test-driven workshop is structured as a series of exercises. Each exercise is a Rust project with a set of tests that verify the correctness of the solution. `wr` will run the tests for the current exercise and, if they pass, allow you to move on to the next exercise while @@ -97,4 +112,3 @@ exercises-dir = "my-top-level-folder" ``` You can refer to [rust-telemetry-workshop](https://github.com/mainmatter/rust-telemetry-workshop) as an example. - diff --git a/wr.gif b/wr.gif deleted file mode 100644 index 5689cd7..0000000 Binary files a/wr.gif and /dev/null differ