-
Notifications
You must be signed in to change notification settings - Fork 326
122 lines (121 loc) · 3.58 KB
/
publish-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: publish documents
on: [workflow_dispatch]
env:
ROOT_DIRECTORY: ./
WORKING_DIRECTORY: ./apps/chart
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout branch
uses: actions/checkout@v2
- name: use Node.js 15.x
uses: actions/setup-node@v1
with:
node-version: '15.x'
- name: npm install
run: |
npm install
- name: npm install (toast.ui-chart)
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm install
- name: eslint
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run lint
types:
runs-on: ubuntu-latest
steps:
- name: checkout branch
uses: actions/checkout@v2
- name: use Node.js 15.x
uses: actions/setup-node@v1
with:
node-version: '15.x'
- name: npm install
run: |
npm install
- name: npm install (toast.ui-chart)
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm install
- name: check types
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run check-types
test:
runs-on: ubuntu-latest
steps:
- name: checkout branch
uses: actions/checkout@v2
- name: use Node.js 15.x
uses: actions/setup-node@v1
with:
node-version: '15.x'
- name: npm install
run: |
npm install
- name: npm install (toast.ui-chart)
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm install
- name: test
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run test
doc:
runs-on: ubuntu-latest
needs: [lint, types, test]
steps:
- name: checkout branch
uses: actions/checkout@v2
- name: check package version
id: check
uses: PostHog/check-package-version@v2
with:
path: ${{ env.WORKING_DIRECTORY }}
- name: use Node.js 15.x
uses: actions/setup-node@v1
with:
node-version: '15.x'
registry-url: https://registry.npmjs.org/
- name: npm install
run: |
npm install
- name: npm install (toast.ui-chart)
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm install
- name: Install @toast-ui/doc
run: |
npm i -g @toast-ui/doc
- name: build
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run build
- name: run doc
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
npm run doc
mv _${{ steps.check.outputs.committed-version }} ../../_${{ steps.check.outputs.committed-version }}
mv -i _latest ../../_latest
git checkout -- package-lock.json
git checkout -- ../../package-lock.json
git remote update
git fetch
git checkout gh-pages
cd ../../
rm -rf latest
rm -rf ${{ steps.version.outputs.committed-version }}
mv _${{ steps.check.outputs.committed-version }} ${{ steps.check.outputs.committed-version }}
mv -i _latest latest
git config --local user.email "[email protected]"
git config --local user.name "jwlee1108"
git add ${{ steps.check.outputs.committed-version }}
git add latest
git commit -m '${{ steps.check.outputs.committed-version }}'
git push origin gh-pages
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}