blob: c56bc5bf85d902e50e5a771cef2267f9935f8529 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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 "$@"
|