Skip to content

Commit a013cd6

Browse files
committed
Add publishing to Github Pages
1 parent be22ba7 commit a013cd6

File tree

6 files changed

+53
-11
lines changed

6 files changed

+53
-11
lines changed

.eleventy.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
module.exports = {
2-
dir: {
3-
input: "src",
4-
output: "dist",
5-
},
1+
module.exports = (eleventyConfig) => {
2+
eleventyConfig.addPassthroughCopy("src/CNAME");
3+
4+
return {
5+
dir: {
6+
input: "src",
7+
output: "docs",
8+
},
9+
};
610
};

.github/workflows/gh-pages.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: github pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
submodules: true
15+
fetch-depth: 0
16+
17+
- name: Setup Node
18+
uses: actions/[email protected]
19+
with:
20+
node-version: '12.x'
21+
22+
- name: Cache dependencies
23+
uses: actions/cache@v2
24+
with:
25+
path: ~/.npm
26+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-node-
29+
30+
- run: npm ci
31+
- run: npm run build
32+
33+
- name: Deploy
34+
uses: peaceiris/actions-gh-pages@v3
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./docs

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
dist/
1+
docs/
22
node_modules/

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
dist
2-
node_modules
1+
docs/
2+
node_modules/

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"clean": "rm -rf dist && mkdir -p dist/styles",
8-
"dev": "npm run clean && postcss src/styles/global.css > dist/styles/global.css && eleventy --serve",
9-
"build": "npm run clean && NODE_ENV=production postcss src/styles/global.css > dist/styles/global.css && eleventy",
7+
"clean": "rm -rf docs && mkdir -p docs/styles",
8+
"dev": "npm run clean && postcss src/styles/global.css > docs/styles/global.css && eleventy --serve",
9+
"build": "npm run clean && NODE_ENV=production postcss src/styles/global.css > docs/styles/global.css && eleventy",
1010
"format": "prettier --write src"
1111
},
1212
"keywords": [],

src/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kdl.dev

0 commit comments

Comments
 (0)