Skip to content

Commit 1a9d726

Browse files
committed
CI: add website
1 parent b785721 commit 1a9d726

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

.github/workflows/website.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: website
2+
on:
3+
push:
4+
branches:
5+
- master
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v2
15+
with:
16+
node-version: 14
17+
- name: Set Env
18+
run: |
19+
echo "OWNER_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')" >> $GITHUB_ENV
20+
echo "REPO_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')" >> $GITHUB_ENV
21+
echo "CURRENT_VERSION=$(node -p 'require("./package.json").version')" >> $GITHUB_ENV
22+
- name: Install
23+
run: npm install
24+
working-directory: example/
25+
- name: Build
26+
run: npm run website -- --metadataversion="${CURRENT_VERSION}"
27+
env:
28+
OWNER_NAME: ${{ env.OWNER_NAME }}
29+
REPO_NAME: ${{ env.REPO_NAME }}
30+
CURRENT_VERSION: ${{ env.CURRENT_VERSION }}
31+
working-directory: example/
32+
- name: Deploy
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./example/dist

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist/
12
### https://raw.github.com/github/gitignore/608690d6b9a78c2a003affc792e49a84905b3118/Node.gitignore
23

34
# Logs
File renamed without changes.

example/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
{
22
"private": true,
3+
"name": "textlint-rule-preset-ja-technical-writing",
4+
"version": "5.0.0",
5+
"homepage": "https://github.com/textlint-ja/textlint-rule-preset-ja-technical-writing",
36
"scripts": {
47
"textlint": "textlint ../README.md",
5-
"test": "npm run textlint"
8+
"test": "npm run textlint",
9+
"website": "textlint-website-generator --cwd `pwd` --textlintrc ./example/.textlintrc --output-dir ./dist"
610
},
711
"devDependencies": {
12+
"@textlint/website-generator": "^0.10.2",
813
"textlint": "^11.9.0",
914
"textlint-filter-rule-comments": "^1.2.2",
1015
"textlint-rule-preset-ja-technical-writing": "file:../"
1116
}
12-
}
17+
}

0 commit comments

Comments
 (0)