File tree

1 file changed

+56
-22
lines changed

1 file changed

+56
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: Deploy
22
on:
3+
workflow_dis:
34
push:
45
branches:
56
- master
67
jobs:
7-
build:
8+
deploy:
89
if: .actor == 'andersevenrud' || .actor == 'os-js'
910
name: Build and deploy
1011
runs-on: ubuntu-latest
@@ -14,29 +15,62 @@ jobs:
1415
with:
1516
node-version: '8.x'
1617
- name: Global dependencies
17-
run: sudo npm install -g gitbook-cli
18+
run: |
19+
npm install -g \
20+
esdoc \
21+
esdoc-node \
22+
esdoc-standard-plugin \
23+
esdoc-publish-html-plugin \
24+
esdoc-lint-plugin \
25+
esdoc-coverage-plugin \
26+
esdoc-accessor-plugin \
27+
esdoc-type-inference-plugin \
28+
esdoc-external-ecmascript-plugin \
29+
esdoc-brand-plugin \
30+
esdoc-undocumented-identifier-plugin \
31+
esdoc-unexported-identifier-plugin \
32+
esdoc-integrate-test-plugin \
33+
esdoc-integrate-manual-plugin \
34+
esdoc-ecmascript-proposal-plugin
1835
- name: Local dependencies
1936
run: npm install
20-
- name: Build v3
21-
run: gitbook build
22-
- name: Build v2
23-
run: node index.js
24-
- name: Build dist
37+
- name: Build manual
38+
run: npx gitbook build
39+
- name: Build API documentation
40+
run: |
41+
mkdir repos
42+
cd repos
43+
git clone --depth=1 https://.com/os-js/osjs-client.git
44+
(cd osjs-client && esdoc)
45+
git clone --depth=1 https://.com/os-js/osjs-common.git
46+
(cd osjs-common && esdoc)
47+
git clone --depth=1 https://.com/os-js/osjs-dialogs.git
48+
(cd osjs-dialogs && esdoc)
49+
git clone --depth=1 https://.com/os-js/osjs-event-emitter.git
50+
(cd osjs-event-emitter && esdoc)
51+
git clone --depth=1 https://.com/os-js/osjs-gui.git
52+
(cd osjs-gui && esdoc)
53+
git clone --depth=1 https://.com/os-js/osjs-panels.git
54+
(cd osjs-panels && esdoc)
55+
git clone --depth=1 https://.com/os-js/osjs-server.git
56+
(cd osjs-server && esdoc)
57+
git clone --depth=1 https://.com/os-js/osjs-widgets.git
58+
(cd osjs-widgets && esdoc)
59+
- name: Create dist
2560
run: |
26-
mkdir dist
27-
cp public/*.* dist/
28-
cp -r _metalsmith dist/v2
29-
cp -r _book dist/v3
61+
mkdir -p dist/api
3062
echo "${{ secrets.GA_CONTENTS }}" > "dist/${{ secrets.GA_FILENAME }}"
31-
echo "${{ secrets.GA_CONTENTS }}" > "dist/v2/${{ secrets.GA_FILENAME }}"
32-
echo "${{ secrets.GA_CONTENTS }}" > "dist/v2/${{ secrets.GA_FILENAME }}"
63+
cp -r _book/* dist/
64+
cp -r repos/osjs-client/doc dist/api/osjs-client
65+
cp -r repos/osjs-common/doc dist/api/osjs-common
66+
cp -r repos/osjs-dialogs/doc dist/api/osjs-dialogs
67+
cp -r repos/osjs-event-emitter/doc dist/api/osjs-event-emitter
68+
cp -r repos/osjs-gui/doc dist/api/osjs-gui
69+
cp -r repos/osjs-panels/doc dist/api/osjs-panels
70+
cp -r repos/osjs-server/doc dist/api/osjs-server
71+
cp -r repos/osjs-widgets/doc dist/api/osjs-widgets
3372
- name: Deploy
34-
uses: AEnterprise/[email protected]
35-
env:
36-
DEPLOY_KEY: ${{ secrets.RSYNC_SSH_KEY }}
37-
ARGS: "-r --delete-after --quiet"
38-
SERVER_PORT: ${{ secrets.RSYNC_SSH_PORT }}
39-
FOLDER: "./dist/*"
40-
SERVER_IP: ${{ secrets.RSYNC_SSH_IP }}
41-
USERNAME: ${{ secrets.RSYNC_SSH_USERNAME }}
42-
SERVER_DESTINATION: ${{ secrets.RSYNC_SSH_PATH }}
73+
uses: peaceiris/actions-gh-pages@v3
74+
with:
75+
_token: ${{ secrets._TOKEN }}
76+
publish_dir: ./dist

0 commit comments

Comments
 (0)