Skip to content

Instantly share code, notes, and snippets.

@phyng
Created January 26, 2017 15:22
Show Gist options
  • Save phyng/b449c759f1e530dbd075fdd2ad65a261 to your computer and use it in GitHub Desktop.
Save phyng/b449c759f1e530dbd075fdd2ad65a261 to your computer and use it in GitHub Desktop.

Revisions

  1. phyng created this gist Jan 26, 2017.
    15 changes: 15 additions & 0 deletions deploy.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@

    # subfolder: dist
    # ref: https://gist.github.com/cobyism/4730490

    # save the last commit id
    old_commit=$(git log -1 --pretty=format:"%h")

    # force add dist and commit
    git add dist -f && git commit -m "build: build prod"

    # force push subtree
    git push origin `git subtree split --prefix dist master`:gh-pages --force

    # reset to old_commit
    git reset "${old_commit}"