Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
Browse files Browse the repository at this point in the history
… fixup! fixup! Allow building all the slides at once
  • Loading branch information
tdittr committed Aug 13, 2024
1 parent 020540d commit a6c9e7c
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 53 deletions.
62 changes: 9 additions & 53 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,79 +16,35 @@ concurrency:
cancel-in-progress: false

jobs:
book:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: book
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install mdbook
run: |
wget "https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz"
tar -xzf mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz
- name: Build book
run: ./mdbook build
- uses: actions/upload-artifact@v4
with:
name: book-output
path: book/target/

slides:
runs-on: ubuntu-latest
defaults:
run:
working-directory: slides/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies
cp mdbook /usr/bin/
- name: Install npm dependencies
run: npm install

- name: Build
run: |
for f in *.md; do
npm run build -- --base /${{github.event.repository.name}}/slides/$(basename $f .md) --out dist/$(basename $f .md) $f
done
- uses: actions/upload-artifact@v4
with:
name: slides-output
path: slides/dist/
run: ./build-all.sh ${{github.event.repository.name}}

upload:
needs:
- book
- slides
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: book-output
path: public/
- uses: actions/download-artifact@v4
with:
name: slides-output
path: public/slides/
- name: Move stuff into single folder
run: |
for f in public/slides/*;
do
echo "/slides/$f/\* /slides/$f/index.html 200" >> public/_redirects
done
cat public/_redirects
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifacts
uses: actions/upload-pages-artifact@v3
with:
path: public/

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: upload
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*/**/target
target
.idea
public/
4 changes: 4 additions & 0 deletions book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ multilingual = false

[build]
build-dir = "./target"

[output.html]
git-repository-url = "https://github.com/tweedegolf/rust-training/"
site-url = "/rust-training/"
24 changes: 24 additions & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -eo pipefail

echo "TODO: use $1 as base"

rm -rf public/
mkdir -p public/

# build mdbook
pushd book
mdbook build
popd
mv book/target/* ./public/

# build slides
pushd slides
npm install
for f in *.md;
do
npm run build -- --out "dist/$(basename "$f" .md)" --base "/rust-training/slides/$(basename "$f" .md)/" "$f"
done
popd
mv slides/dist ./public/slides
1 change: 1 addition & 0 deletions slides/1_1-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fonts:
drawings:
persist: false
layout: cover
routerMode: hash
---


Expand Down
1 change: 1 addition & 0 deletions slides/2_1-basic-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 2.1: Basic Syntax"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/2_2-ownership-and-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 2.2: Ownership and References"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/2_3-advanced-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 2.3: Advanced Syntax"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/2_4-traits-and-generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 2.4: Traits and Generics"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/2_5-closures-and-dynamic-dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 2.5: Closures and Dynamic dispatch"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/3_1-crate-engineering.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 3.1: Crate Engineering"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/4_1-introduction-to-multitasking.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 4.1: Introduction to Multitasking"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/4_2-parallel-multitasking.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 4.2: Parallel Multitasking"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/4_3-asynchronous-multitasking.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 4.3: Asynchronous Multitasking"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/5_1-rust-for-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 5.1: Rust for Web"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/6_1-foreign-function-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 6.1: Foreign Function Interface"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/7_1-rust-from-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 7.1: Calling Rust from Python"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/8_1-embedded-ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 8.1: The Rust Embedded Ecosystem"
routerMode: hash
---

<style type="text/css" rel="stylesheet">
Expand Down
1 change: 1 addition & 0 deletions slides/8_2-portable-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 8.2: Portable Rust drivers"
routerMode: hash
---

<style type="text/css" rel="stylesheet">
Expand Down
1 change: 1 addition & 0 deletions slides/8_3-async-on-embedded.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 8.3: Async on Embedded"
routerMode: hash
---

<style type="text/css" rel="stylesheet">
Expand Down
1 change: 1 addition & 0 deletions slides/8_4-embassy-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fonts:
mono: Fira Mono
layout: cover
title: "Rust - 8.4 the Embassy framework"
routerMode: hash
---

# Rust programming
Expand Down
1 change: 1 addition & 0 deletions slides/Y-ecosystem-and-tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ lineNumbers: true
drawings:
persist: false
layout: cover
routerMode: hash
---
# Rust programming

Expand Down
1 change: 1 addition & 0 deletions slides/Z-wrap-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fonts:
drawings:
persist: false
layout: cover
routerMode: hash
---


Expand Down

0 comments on commit a6c9e7c

Please sign in to comment.