Skip to content

Commit 9ade90e

Browse files
authored
Docs: Automatically build and deploy as artifact (#225)
2 parents 02a3ed5 + 560e13a commit 9ade90e

File tree

10,160 files changed

+51
-1136542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,160 files changed

+51
-1136542
lines changed
File renamed without changes.
File renamed without changes.

.github/workflows/update.yml

Lines changed: 27 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# This is a basic workflow to help you get started with Actions
2-
3-
name: update github page
1+
name: Update GitHub page
42

53
env:
64
github-registry: https://npm.pkg.github.com
@@ -13,9 +11,6 @@ on:
1311
push:
1412
branches:
1513
- main
16-
# schedule:
17-
# - cron: '0 4 * * *'
18-
# workflow_call:
1914
workflow_dispatch:
2015

2116
jobs:
@@ -27,36 +22,36 @@ jobs:
2722
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
2823
- uses: actions/setup-node@v4
2924
with:
30-
node-version: 16
25+
node-version: 20
3126
registry-url: "${{env.npmjs-registry}}"
3227
scope: "@${{env.scope}}"
28+
3329
- uses: pnpm/action-setup@v4
3430
id: pnpm-install
3531
with:
36-
version: 8
32+
version: 9
3733
run_install: false
34+
3835
- name: Get pnpm store directory
3936
id: pnpm-cache
4037
shell: bash
4138
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
39+
4240
- uses: actions/cache@v4
4341
with:
4442
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
45-
key: ${{ runner.os }}-pnpm-store # -${{ hashFiles('**/pnpm-lock.yaml') }}
43+
key: ${{ runner.os }}-pnpm-store
4644
restore-keys: |
4745
${{ runner.os }}-pnpm-store
4846
49-
# - name: Build doc
50-
# env:
51-
# NODE_AUTH_TOKEN: ${{env.token}}
52-
# run: |
53-
# pnpm install --no-frozen-lockfile
54-
# npm run build
55-
# working-directory: dev
47+
- name: Build Docs
48+
run: |
49+
pnpm install --no-frozen-lockfile
50+
npm run build
5651
5752
- uses: actions/setup-node@v4
5853
with:
59-
node-version: 18
54+
node-version: 20
6055
registry-url: "${{env.github-registry}}"
6156
scope: "@${{env.scope}}"
6257

@@ -68,12 +63,11 @@ jobs:
6863
npm pack @${{env.scope}}/designer@^1
6964
tar -xzvf public-ui-designer-*.tgz
7065
71-
rm -rf ../docs/v1/designer
72-
mkdir -p ../docs/v1
73-
mv package/dist ../docs/v1/designer
66+
rm -rf build/v1/designer
67+
mkdir -p build/v1
68+
mv package/dist build/v1/designer
7469
7570
rm -rf package *.tgz
76-
working-directory: dev
7771
7872
- name: Download sample react (v1)
7973
env:
@@ -83,12 +77,11 @@ jobs:
8377
npm pack @${{env.scope}}/sample-react@^1
8478
tar -xzvf public-ui-sample-react-*.tgz
8579
86-
rm -rf ../docs/v1/sample-react
87-
mkdir -p ../docs/v1
88-
mv package/dist ../docs/v1/sample-react
80+
rm -rf build/v1/sample-react
81+
mkdir -p build/v1
82+
mv package/dist build/v1/sample-react
8983
9084
rm -rf package *.tgz
91-
working-directory: dev
9285
9386
- name: Download designer (v2)
9487
env:
@@ -98,12 +91,11 @@ jobs:
9891
npm pack @${{env.scope}}/designer@^2
9992
tar -xzvf public-ui-designer-*.tgz
10093
101-
rm -rf ../docs/v2/designer
102-
mkdir -p ../docs/v2
103-
mv package/dist ../docs/v2/designer
94+
rm -rf build/v2/designer
95+
mkdir -p build/v2
96+
mv package/dist build/v2/designer
10497
10598
rm -rf package *.tgz
106-
working-directory: dev
10799
108100
- name: Download sample react (v2)
109101
env:
@@ -113,48 +105,13 @@ jobs:
113105
npm pack @${{env.scope}}/sample-react@^2
114106
tar -xzvf public-ui-sample-react-*.tgz
115107
116-
rm -rf ../docs/v2/sample-react
117-
mkdir -p ../docs/v2
118-
mv package/dist ../docs/v2/sample-react
108+
rm -rf build/v2/sample-react
109+
mkdir -p build/v2
110+
mv package/dist build/v2/sample-react
119111
120112
rm -rf package *.tgz
121-
working-directory: dev
122-
123-
# - name: Download slidev
124-
# env:
125-
# NODE_AUTH_TOKEN: ${{env.token}}
126-
# run: |
127-
# rm -rf package *.tgz
128-
# npm pack @${{env.scope}}/slidev
129-
# tar -xzvf public-ui-slidev-*.tgz
130-
# mv package/dist build/presentation
131-
# mv package/presentation.pdf build/presentation/presentation.pdf
132-
# rm -rf package *.tgz
133-
# ls -la build
134-
# working-directory: dev
135-
136-
# - name: Download storybook
137-
# env:
138-
# NODE_AUTH_TOKEN: ${{env.token}}
139-
# run: |
140-
# rm -rf package *.tgz
141-
# npm pack @${{env.scope}}/storybook
142-
# tar -xzvf public-ui-storybook-*.tgz
143-
# mv package/dist build/storybook
144-
# rm -rf package *.tgz
145-
# ls -la build
146-
# working-directory: dev
147-
148-
- name: Commit changed files
149-
continue-on-error: true
150-
run: |
151-
git config --local user.email "action@github.com"
152-
git config --local user.name "GitHub Action"
153-
git add .
154-
git status
155-
git commit -m "Auto update github page"
156113
157-
- uses: ad-m/github-push-action@master
114+
- name: Upload GitHub Pages artifact
115+
uses: actions/upload-pages-artifact@v3.0.1
158116
with:
159-
github_token: ${{ secrets.GITHUB_TOKEN }}
160-
force: true
117+
path: build

.gitignore

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
# Dependencies
2-
/dev/node_modules/
3-
/dev/docs/readmes/
2+
node_modules/
3+
docs/readmes/
44

55
# Production
6-
/dev/build/
6+
build/
77

88
# Generated files
9-
/dev/.docusaurus
10-
/dev/.cache-loader
11-
/docs2/
9+
.docusaurus
10+
.cache-loader
11+
readmes
12+
13+
# Copied assets
14+
/static/assets/bpa-icons/
15+
/static/assets/bundes/
16+
/static/assets/codicons/
17+
/static/assets/fontawesome-free/
18+
/static/assets/icofont/
19+
/static/assets/kreon/
20+
/static/assets/material-icons/
21+
/static/assets/material-symbols/
22+
/static/assets/noto-sans/
23+
/static/assets/roboto/
24+
/static/assets/tabler-icons/
25+
/static/assets/kolibri.ico
26+
/static/cheat-sheet/
27+
/static/assets/components-esm
28+
/static/assets/themes
1229

1330
# Misc
1431
.DS_Store
File renamed without changes.

dev/.npmrc renamed to .npmrc

File renamed without changes.
File renamed without changes.
File renamed without changes.

dev/README.md renamed to README.md

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

dev/.gitignore

Lines changed: 0 additions & 40 deletions
This file was deleted.

dev/.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/-.htaccess

Lines changed: 0 additions & 74 deletions
This file was deleted.

docs/-manifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)