diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml new file mode 100644 index 0000000..bfe6e75 --- /dev/null +++ b/.github/workflows/web.yml @@ -0,0 +1,98 @@ +# 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: 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 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f06c2d8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hickory-dns"] + path = hickory-dns + url = git@github.com:hickory-dns/hickory-dns.git diff --git a/hickory-dns b/hickory-dns new file mode 160000 index 0000000..6c2a1e2 --- /dev/null +++ b/hickory-dns @@ -0,0 +1 @@ +Subproject commit 6c2a1e2c238eaecff2b6b6c1c0e435685bc0997e diff --git a/justfile b/justfile index 317af59..6bb2cf0 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,4 @@ export MDBOOK_BIN := "mdbook" -export ZOLA_BIN := "zola" export CURRENT_BRANCH := `git branch --show-current` export TMP_GH_PAGES_SITE := "/tmp/publishing-site" @@ -9,6 +8,7 @@ init: brew --version # zola --version || brew install zola mdbook --version || cargo install -f mdbook + mdbook-mermaid --version || cargo install -f mdbook-mermaid oranda --version || cargo install -f oranda --locked --profile=dist @echo current git branch: ${CURRENT_BRANCH} @@ -16,16 +16,11 @@ clean: @echo "====> cleaning build directories" rm -rf public -book: init - @echo "====> building the book" - ${MDBOOK_BIN} build +oranda: clean + @echo "====> building oranda site" + oranda build -zola: init - @echo "====> building the zola site" - ${ZOLA_BIN} build - cp .nojekyll public/.nojekyll - -build: book +build: oranda gh-pages: @echo "====> checking for gh-pages branch" @@ -40,7 +35,7 @@ clean_worktree: rm -rf ${TMP_GH_PAGES_SITE} git worktree prune -deploy: gh-pages clean build +deploy: gh-pages clean oranda @echo "====> deploying to github" @git --version git worktree add ${TMP_GH_PAGES_SITE} gh-pages diff --git a/oranda.json b/oranda.json new file mode 100644 index 0000000..6efd94e --- /dev/null +++ b/oranda.json @@ -0,0 +1,13 @@ +{ + "styles": { + "theme": "hacker", + "favicon": "static/favicon.ico", + "logo": "static/logo.png" + }, + "project": { + "name": "Hickory DNS", + "readme_path": "hickory-dns/README.md", + "repository": "https://github.com/hickory-dns/hickory-dns", + "license": "MIT OR Apache-2.0" + } + } \ No newline at end of file diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100755 index 0000000..7a18053 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/logo.png b/static/logo.png new file mode 100755 index 0000000..c905c65 Binary files /dev/null and b/static/logo.png differ