1

I have made a number of changes to an Angular repo on a branch called feat/demo-mode and I want to publish this branch to GitHub Pages.

Under the GitHub Pages section, I chose my branch as outlined here configuring-a-publishing-source-for-your-github-pages-site.

I have added/updated the following scripts in package.json

"build": "ng build --prod --base-href /my-example-repo/",
"predeploy": "npm run build",
"deploy": "npx angular-cli-ghpages --dir=dist/my-example-repo --branch=feat/demo-mode --message='Deploy to GitHub Pages'"

When I run npm run deploy, the app builds and deploys. I can now visit it on https://funfair-tech.github.io/my-example-repo/, however the code in feat/demo-mode has now been replaced with the contents of my dist folder.

AngularBoy
  • 1,715
  • 2
  • 25
  • 35

1 Answers1

0

So I updated my package scripts to this:

"build": "ng build --prod --base-href \"/funfair-client/\"",
"deploy": "npm run build && npx angular-cli-ghpages --dir dist/my-example-repo"

After I ran npm run deploy the first time, I went into GitHub Pages and changed the publishing source to gh-pages. Now when I make a change in the feature branch, I push the changes to git then run npm run deploy again.

AngularBoy
  • 1,715
  • 2
  • 25
  • 35