Skip to content

Instantly share code, notes, and snippets.

View tevashov's full-sized avatar

Teff tevashov

View GitHub Profile
@tevashov
tevashov / NPM gh-pages script.md
Last active November 8, 2022 07:24 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io). #GitHub

Using https://www.npmjs.com/package/gh-pages was the way to go for me. Saves tons of headaches especially if you're working with others.

If you already have a "gh-pages" branch, use the 1st command below. If you don't have a "gh-pages" branch, initialize it by using the 2nd command below. Make it easier to run by creating scripts like these in your package.json file:

"scripts": {
      "gh-deploy": "git push origin :gh-pages && git subtree push --prefix dist origin gh-pages"
      "gh-deploy-init": "git push origin && git subtree push --prefix dist origin gh-pages",
}
@tevashov
tevashov / release.yaml
Last active November 8, 2022 07:25 — forked from mircohacker/release.yaml
Push to Github Pages with Github Actions #GitHub
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️