diff --git a/.eleventy.js b/.eleventy.js index 23cd790..b06a7a3 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,6 +1,10 @@ -module.exports = { - dir: { - input: "src", - output: "dist", - }, +module.exports = (eleventyConfig) => { + eleventyConfig.addPassthroughCopy("src/CNAME"); + + return { + dir: { + input: "src", + output: "docs", + }, + }; }; diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..0bb976d --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,37 @@ +name: github pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v2.1.2 + with: + node-version: '12.x' + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npm ci + - run: npm run build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs diff --git a/.gitignore b/.gitignore index 763301f..d069d53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -dist/ +docs/ node_modules/ \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index db4c6d9..d069d53 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,2 @@ -dist -node_modules \ No newline at end of file +docs/ +node_modules/ \ No newline at end of file diff --git a/package.json b/package.json index ceba514..2927b64 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "", "main": "index.js", "scripts": { - "clean": "rm -rf dist && mkdir -p dist/styles", - "dev": "npm run clean && postcss src/styles/global.css > dist/styles/global.css && eleventy --serve", - "build": "npm run clean && NODE_ENV=production postcss src/styles/global.css > dist/styles/global.css && eleventy", + "clean": "rm -rf docs && mkdir -p docs/styles", + "dev": "npm run clean && postcss src/styles/global.css > docs/styles/global.css && eleventy --serve", + "build": "npm run clean && NODE_ENV=production postcss src/styles/global.css > docs/styles/global.css && eleventy", "format": "prettier --write src" }, "keywords": [], diff --git a/src/CNAME b/src/CNAME new file mode 100644 index 0000000..d59a0d3 --- /dev/null +++ b/src/CNAME @@ -0,0 +1 @@ +kdl.dev \ No newline at end of file