Skip to content

Commit 9566375

Browse files
author
Eduard Kyvenko
committed
docs($guide): Added a guide for deploying to GitHub pages
1 parent f0ee283 commit 9566375

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

template/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ You can find the most recent version of this guide [here](https://github.com/hal
2020
- [reactor](#reactor)
2121
- [Adding Images and Fonts](#adding-images-and-fonts)
2222
- [IDE setup for Hot Module Replacement](#ide-setup-for-hot-module-replacement)
23+
- [Deploying to GitHub Pages](#deploying-to-github-pages)
2324

2425
## Sending feedback
2526
You are very welcome with any [feedback](https://github.com/halfzebra/create-elm-app/issues)
@@ -152,3 +153,25 @@ view model =
152153

153154
## IDE setup for Hot Module Replacement
154155
Remember to disable [safe write](https://webpack.github.io/docs/webpack-dev-server.html#working-with-editors-ides-supporting-safe-write) if you are using VIM or IntelliJ IDE, such as WebStorm.
156+
157+
## Deploying to GitHub Pages
158+
159+
#### Step 1: install [gh-pages](https://github.com/tschaub/gh-pages)
160+
```sh
161+
npm install gh-pages -g
162+
```
163+
164+
#### Step 2: configure `SERVED_PATH` environment variable
165+
Create a `.env` file in the root of your project to specify the `SERVED_PATH` environment variable.
166+
167+
```
168+
SERVED_PATH=./
169+
```
170+
171+
The path must be `./` so the assets are served using relative paths.
172+
173+
#### Step 3: build the project and deploy it to GitHub Pages
174+
```sh
175+
elm-app build
176+
gh-pages -d dist
177+
```

0 commit comments

Comments
 (0)