Skip to content

Commit

Permalink
Oranda setup.
Browse files Browse the repository at this point in the history
Adds a basic oranda setup and empty mdbook to the repo.
  • Loading branch information
esmevane committed Jun 19, 2024
1 parent bd349be commit 4b8c6dd
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 1 deletion.
101 changes: 101 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# 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/latest/download/oranda-installer.sh | sh
oranda build
# Remove the comments below to enable link checking and Github Pages deployment

# - name: Prepare HTML for link checking
# # untitaker/hyperlink supports no site prefixes, move entire site into
# # a subfolder
# run: mkdir /tmp/public/ && cp -R public /tmp/public/oranda

# - name: Check HTML for broken internal links
# uses: untitaker/hyperlink@0.1.29
# with:
# args: /tmp/public/

# # 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target

# Generated by `oranda generate ci`
public/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Service Kit preconfigures multiple kinds of interfaces:

(This is a checklist / todo list until I've fully set these all up.)

- [ ] Release and documentation page managed by [cargo-dist][] and [oranda][].
- [x] Release process and documentation page managed by [cargo-dist][] and [oranda][].
- [x] CLI with [clap.rs][], [dialoguer][], [console][] and [indicatif][], for robust CLI interactors and programmatic access needs.
- [x] A component-driven non-blocking terminal UI made with [ratatui][] and [crossterm][] for anyone who wants to be a little extra about their console work (me; I always do).
- [x] A web service built with [axum][] and a web client made with [reqwest][] to interact with it.
Expand Down
19 changes: 19 additions & 0 deletions oranda-workspace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"workspace": {
"name": "Service Kit",
"members": [
{
"slug": "service-kit",
"path": "./service-kit"
}
]
},
"components": {
"mdbook": {
"path": "../service-kit-book"
}
},
"styles": {
"theme": "axodark"
}
}
1 change: 1 addition & 0 deletions service-kit-book/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
book
6 changes: 6 additions & 0 deletions service-kit-book/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["Joseph McCormick"]
language = "en"
multilingual = false
src = "src"
title = "Service Kit"
3 changes: 3 additions & 0 deletions service-kit-book/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 service-kit-book/src/chapter_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Chapter 1

0 comments on commit 4b8c6dd

Please sign in to comment.