Add this to config/environment.js:
if (environment === 'production') {
ENV.baseURL = '/GITHUB-REPO-NAME/dist';
ENV.locationType = 'hash';
}Place the .sh file in scripts/ folder.
bash scripts/deploy-to-github-pages.sh
Add this to config/environment.js:
if (environment === 'production') {
ENV.baseURL = '/GITHUB-REPO-NAME/dist';
ENV.locationType = 'hash';
}Place the .sh file in scripts/ folder.
bash scripts/deploy-to-github-pages.sh
| echo "Switch to gh-pages branch" | |
| git checkout gh-pages | |
| git merge master | |
| echo "Clean up" | |
| rm -rf dist | |
| echo "Create new production build" | |
| ember build --environment production | |
| echo "Add dist to commit and push it to GitHub" | |
| git add dist --force | |
| git commit -m "deploy" | |
| git push | |
| echo "Switch back to master branch" | |
| git checkout master |
| <html> | |
| <head> | |
| <meta http-equiv="refresh" content="1;http://joekarasek.github.io/GITHUB-REPO-NAME/dist/index.html" /> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
This is so helpful! Thanks, guys!
This was a life saver, thanks so much!
Wanted to add a couple more steps for when you make updates to the site and need to refresh the gh-pages. May be obvious, but wanted to document it.
Taylor, thanks for the step-by-step!