Skip to content

Commit 3bd49f2

Browse files
committed
Add workflow to deploy to GitHub Pages
Closes #48.
1 parent 5c4e09f commit 3bd49f2

3 files changed

Lines changed: 28 additions & 10 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: GitHub Pages
2+
on: workflow_dispatch
3+
jobs:
4+
deploy:
5+
name: Deploy
6+
runs-on: ubuntu-latest
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Setup node
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: 12
16+
- name: Install
17+
run: npm install
18+
- name: Build
19+
run: npm run build
20+
- name: Deploy
21+
uses: peaceiris/actions-gh-pages@v3
22+
if: ${{ github.ref == 'refs/heads/master' }}
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
publish_dir: ./dist
26+
cname: leveljs.org

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,7 @@ npm start
5858

5959
### For maintainers
6060

61-
`npm run deploy` builds the static site, switches to the gh-pages branch and
62-
puts the built site in the root, and then does git push origin gh-pages.
63-
64-
```
65-
git fetch
66-
git checkout master # if you're not already on it
67-
git merge <fork-branch>
68-
npm run deploy
69-
```
61+
Manually trigger the GitHub Actions workflow to deploy to gh-pages.
7062

7163
## Donate
7264

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start": "run-p build-assets watch-styles watch-pug server",
1111
"watch-styles": "stylus -w ./assets/styl/ -o ./dist/css/",
1212
"watch-pug": "pug --watch ./assets/pug/index.pug --out ./dist/",
13-
"build": "npm run build-styles && npm run build-pug && npm run build-assets && echo leveljs.org > dist/CNAME",
13+
"build": "npm run build-styles && npm run build-pug && npm run build-assets",
1414
"build-styles": "stylus ./assets/styl/ -o ./dist/css/",
1515
"build-pug": "pug ./assets/pug/index.pug --out ./dist/",
1616
"build-assets": "cpy **/* ../../dist --cwd=assets/static --parents",

0 commit comments

Comments
 (0)