Notes by Lesnitsky Subscribe

#github ยท 2020-03-25 07:20 PM Twitter Logo

How to publish dist folder to GitHub pages

I'm using the following script:

#!/bin/bash

current_branch=$(git symbolic-ref --short HEAD)

git branch -D tmp
git branch -D gh-pages
git checkout --orphan tmp &&\
git add -f dist/* &&\
git commit -m "publish" &&\
git subtree split --prefix dist -b gh-pages &&\
git push -f origin gh-pages &&\
git checkout $current_branch