Surge deployment configuration for Perron
rails app:template LOCATION='https://perron.railsdesigner.com/resources/surge/template.rb/'
This snippet adds a deployment binstub for your Perron-powered static site to Surge.sh. It creates a CNAME file for your domain, install the surge package and a complete deploy binstub that handles the entire workflow: building your site, deploying to Surge.sh, and cleaning up the output directory afterward.
Template source
create_file "CNAME", <<~CNAME # Add your custom domain CNAME run "npm install -g surge" create_file "bin/deploy", <<~BASH #!/bin/bash set -e echo "Building site with Perron…" bin/rails perron:build echo "Deploying to Surge.sh…" surge ./output echo "Cleaning up…" rm -rf ./output echo "Deployed" BASH run "chmod +x bin/deploy"