diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..0d10b4e5 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,59 @@ +# 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"] + + # 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: Print environment + run: | + uname -a + nix develop -c env + + - name: Build mdbook + run: | + nix develop -c \ + mdbook build ./docs + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './docs/book' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..5a0bf031 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +/book diff --git a/docs/book.toml b/docs/book.toml new file mode 100644 index 00000000..b7746222 --- /dev/null +++ b/docs/book.toml @@ -0,0 +1,5 @@ +[book] +language = "en" +multilingual = false +src = "src" +title = "orb-software" diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md new file mode 100644 index 00000000..7390c828 --- /dev/null +++ b/docs/src/SUMMARY.md @@ -0,0 +1,3 @@ +# Summary + +- [Chapter 1](./chapter_1.md) diff --git a/docs/src/chapter_1.md b/docs/src/chapter_1.md new file mode 100644 index 00000000..b743fda3 --- /dev/null +++ b/docs/src/chapter_1.md @@ -0,0 +1 @@ +# Chapter 1 diff --git a/flake.nix b/flake.nix index 5cfcea91..3ca6d3f7 100644 --- a/flake.nix +++ b/flake.nix @@ -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, @@ -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