diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-10 23:11:16 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-10 23:11:16 -0400 |
| commit | c500a84b35338ac0f429133a0b07ced8d457976f (patch) | |
| tree | 54d526e4c07c0171f8e6f41933b607a8ab09127c /scripts/deploy-docs.sh | |
| parent | Add note on contributing guide to README (diff) | |
| download | cli-c500a84b35338ac0f429133a0b07ced8d457976f.zip | |
Refactor docs to use mkdocs and sourcehut pages
Diffstat (limited to '')
| -rwxr-xr-x | scripts/deploy-docs.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/scripts/deploy-docs.sh b/scripts/deploy-docs.sh new file mode 100755 index 0000000..c56bc5b --- /dev/null +++ b/scripts/deploy-docs.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +set -eou pipefail + +source "$(dirname "${BASH_SOURCE[0]}")/lib/log.sh" + +readonly SITE="eugenetriguba.srht.site/bolt" + +usage() { + echo "Usage: $0" + echo "" + echo "Build and deploy documentation to SourceHut Pages" + echo "" + echo "Examples:" + echo " $0 # Build and deploy docs to $SITE" +} + +build_docs() { + log_step "Building documentation with MkDocs" + mkdocs build + log_success "Documentation built successfully" +} + +package_site() { + log_step "Creating tarball" + tar -C site -czf site.tar.gz . + log_success "Site packaged as site.tar.gz" +} + +deploy_to_pages() { + log_step "Deploying to SourceHut Pages: $SITE" + hut pages publish -d "$SITE" site.tar.gz + log_success "Documentation deployed to https://$SITE" +} + +main() { + if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then + usage + exit 0 + fi + + log_header "Deploying Documentation" + build_docs + package_site + deploy_to_pages +} + +main "$@" |