Add publishing to Github Pages
This commit is contained in:
parent
be22ba7029
commit
a013cd614c
14
.eleventy.js
14
.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",
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
dist/
|
||||
docs/
|
||||
node_modules/
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
dist
|
||||
node_modules
|
||||
docs/
|
||||
node_modules/
|
||||
|
|
@ -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": [],
|
||||
|
|
|
|||
Loading…
Reference in New Issue