Skip to content

Instantly share code, notes, and snippets.

@steezeburger
Created April 26, 2023 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steezeburger/0c20765ebabe3db57c7157ecab0fb4f2 to your computer and use it in GitHub Desktop.
Save steezeburger/0c20765ebabe3db57c7157ecab0fb4f2 to your computer and use it in GitHub Desktop.
Quick and dirty "deployment" of static files to gh-pages.
#! /bin/bash
# This script was created to make it super easy to use the simplest gh-pages settings,
# which is basically just static files in the docs/ directory on the main branch.
#
# 1) copies CNAME to a temp location
# 2) builds some static files
# 3) copies static files to docs/ dir
# NOTE - replace the following with a command or script that builds your site's static files
npm run build
# copy CNAME to tmp file. this file is used by github for custom domain names.
cp docs/CNAME /tmp/CNAME
# delete existing contest of docs
rm -rf docs/*
# NOTE - may need to edit the following command. copy build files to docs/
cp -r build/* docs/
# copy CNAME file back to docs/
cp /tmp/CNAME docs/CNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment