Skip to content

Commit

Permalink
ci: add mdbook
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah committed Jul 16, 2024
1 parent 531c988 commit f8a238a
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 20 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "add-gh-pages"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac # pin@v22
with:
github_access_token: ${{ secrets.GIT_HUB_TOKEN }}
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # pin@v12
continue-on-error: true
with:
name: worldcoin
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build mdbook
run: mdbook build ./docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './docs/book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/book
5 changes: 5 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[book]
language = "en"
multilingual = false
src = "src"
title = "orb-software"
3 changes: 3 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Summary

- [Chapter 1](./chapter_1.md)
1 change: 1 addition & 0 deletions docs/src/chapter_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chapter 1
34 changes: 14 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,21 @@
# Nix makes the following list of dependencies available to the development
# environment.
buildInputs = (with p.native; [
# Needed for cargo zigbuild
zig
cargo-zigbuild
mdbook # Generates site for docs
protobuf # Needed for orb-messages and other protobuf dependencies
black # Python autoformatter
cargo-binutils # Contains common native development utilities
cargo-deb # Generates .deb packages for orb-os
cargo-deny # Checks licenses and security advisories
cargo-expand # Useful for inspecting macros
cargo-zigbuild # Used to cross compile rust
nixpkgs-fmt # Nix autoformatter
python3
zig # Needed for cargo zigbuild

# Needed for packaging for orb-os
cargo-deb
# This is missing on mac m1 nix, for some reason.
# see https://stackoverflow.com/a/69732679
libiconv

# Used by various rust build scripts to find system libs
# Note that this is the unwrapped version of pkg-config. By default,
Expand All @@ -93,21 +102,6 @@
# env variables ourselves and don't want nix overwriting them, so we
# use the unwrapped version.
pkg-config-unwrapped

# Useful
cargo-deny
cargo-expand
cargo-binutils
protobuf
nixpkgs-fmt

# python stuff
python3
black

# This is missing on mac m1 nix, for some reason.
# see https://stackoverflow.com/a/69732679
libiconv
]) ++ [
rustToolchain
rustPlatform.bindgenHook # Configures bindgen to use nix clang
Expand Down

0 comments on commit f8a238a

Please sign in to comment.