Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Fix site deployment #17

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/gh-pages.yml

This file was deleted.

77 changes: 77 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
#
# Bulid/deployment script for www.rust-bitcoin.org

set -e

root=$(pwd)

main() {
local _deploy=false

if [ "$#" -eq 1 ]; then
if [ "$1" = "--deploy" ]; then
_deploy=true
fi
fi

if [ $_deploy = true ]; then
deploy
else
build
echo ""
echo -e "\033[0;32m Site built, you can serve locally by cd'ing into site/ and running 'hugo serve'...\033[0m"
fi
}

build() {
# Build the cookbook
cd $root
rm -rf "site/static/book"
cd cookbook
mdbook build --dest-dir "../site/static/book"
cd $root

# Build the hugo project.
cd site
hugo
cd $root
}

# Deploy the site to https://github.com/rust-bitcoin/rust-bitcoin.github.io
deploy() {
local _date=$(date --utc)
echo -e "\033[0;32m Deploying site to GitHub...\033[0m"
cd $root

local branch=$(git rev-parse --abbrev-ref HEAD)

if [ $branch != "master" ]; then
echo "Not on master branch, must be on master to deploy"
return 1
fi

build

# Commit changes.
cd site/public
git add -A

msg="Build site `date`"
if [ $# -eq 1 ]
then msg="$1"
fi
git commit -m "$msg"

# Push html to GitHub pages (see public/.git/config)
git push

cd $root
echo -e "\033[0;32m Deployment successful\033[0m"
}

#
# Main
#
main $@
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
body{font-family:open sans,sans-serif;color:#f8f8ff;background-color:#292a2d;margin:0;display:flex;flex-direction:column;min-height:100vh}a{color:#36c}pre code{font-family:fira mono,monospace;font-size:75%;display:block;background:#252627;padding:10px;overflow:auto}code{font-family:fira mono,monospace;font-size:75%}h1{font-family:fira mono,monospace}h2{font-family:fira mono,monospace}h3{font-family:fira mono,monospace}h4{font-family:fira mono,monospace}h5{font-family:fira mono,monospace}h6{font-family:fira mono,monospace}@-ms-viewport{width: device-width; }@font-face{font-family:fira mono;src:url(../fonts/FiraMono/FiraMono-Medium.eot);src:local("Fira Mono"),url(../fonts/FiraMono/FiraMono-Medium.eot)format("embedded-opentype"),url(../fonts/FiraMono/FiraMono-Medium.woff)format("woff"),url(../fonts/FiraMono/FiraMono-Medium.ttf)format("truetype");font-weight:500;font-style:normal}@font-face{font-family:open sans;src:url(../fonts/OpenSans/OpenSans-Regular.eot);src:url(../fonts/OpenSans/OpenSans-Regular.eot?#iefix)format("embedded-opentype"),url(../fonts/OpenSans/OpenSans-Regular.woff)format("woff"),url(../fonts/OpenSans/OpenSans-Regular.ttf)format("truetype"),url(../fonts/OpenSans/OpenSans-Regular.svg#OpenSansRegular)format("svg");font-weight:400;font-style:normal}.footer{padding:15px;text-align:center;background-color:#252627}.footerLink{color:#f8f8ff}.header{font-family:fira mono,monospace;padding:20px;display:flex;justify-content:space-between;align-items:center}@media only screen and (min-width:992px){.header{width:760px}}.headerWrapper{overflow:auto;box-sizing:border-box;background-color:#252627;display:flex;justify-content:center;flex-shrink:0}.headerLinks ul{list-style:none;padding:0;margin:0}.headerLinks ul li{display:inline;margin:5px}.headerLinks ul li a{color:#f8f8ff;text-decoration:none}.terminal{color:#f8f8ff;text-decoration:none}.postDate{float:right;color:#f8f8ff}.postTitle{color:#36c;text-decoration:none;text-transform:capitalize;font-family:fira mono,monospace;font-size:1.2em;float:left}.postHeader{overflow:hidden}.postsList{margin-top:20px}.postListItem{padding:20px;background-color:#2f2f2f;margin-bottom:20px}.postExcerpt{text-align:initial;text-decoration:none;color:#f8f8ff}.headerContainer{display:flex;justify-content:space-between}.noDecoration{text-decoration:none}a,a:link,a:visited,a:hover,a:active{text-decoration:none}.socialNavbar ul{list-style:none;padding:0}.socialNavbar ul li{display:inline}.socialNavbar a{color:#f8f8ff;text-shadow:#2f2f2f 0 0 2px;-webkit-font-smoothing:antialiased;display:inline-block;margin:10px}.postWrapper{text-align:left}.listHeader,.listContent{text-align:left}.indexWrapper{display:flex;flex-direction:column;justify-content:center}.indexHeader{font-size:3em}.content{text-align:center;margin:0 auto;flex:1 auto;padding:20px}@media only screen and (min-width:992px){.content{display:flex;width:760px}}.vertical{display:flex;flex-direction:column;justify-content:center}.flexWrapper{display:flex;flex-direction:column;justify-content:center;min-height:100vh}.main{width:100%;height:100%}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"sass/main.min.4e3efe637d21e3743f006dbceaa8d8f10952bb4f4d19989c58c5afb0fc120a52.css","MediaType":"text/css","Data":{"Integrity":"sha256-Tj7+Y30h43Q/AG286qjY8QlSu09NGZicWMWvsPwSClI="}}
Loading