Skip to content

Commit cd54025

Browse files
committedNov 21, 2024·
refactoring deploy workflow
1 parent 9a611cd commit cd54025

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed
 

‎.github/workflows/deploy.yml

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,44 @@
1-
name: Auto-deployment of Documentation
1+
name: Deploy to Github Pages
22
on:
33
push:
4-
branches: [main]
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
59
jobs:
6-
build-docs:
10+
build-and-deploy:
711
runs-on: ubuntu-latest
812
steps:
913
- name: Checkout
10-
uses: actions/checkout@v3.0.2
14+
uses: actions/checkout@v3
1115
with:
12-
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
16+
fetch-depth: 0
1317

14-
- name: Set up Python 3.
15-
uses: actions/setup-python@v3
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v3
1620
with:
17-
python-version: 3.9
21+
node-version: '16'
22+
cache: 'npm'
23+
cache-dependency-path: './table-component/package-lock.json'
1824

19-
- name: Install Poetry.
20-
uses: snok/install-poetry@v1.3.1
25+
- name: Install and Build
26+
run: |
27+
npm install
28+
cd ./table-component
29+
npm run build
30+
env:
31+
NODE_ENV: production
2132

22-
- name: Install dependencies.
33+
- name: Copy build files
2334
run: |
24-
poetry install --with docs
35+
mkdir -p ../css ../js
36+
cp ./table-component/dist/css/app*.css ../css/app.css
37+
cp ./table-component/dist/css/chunk-vendors*.css ../css/chunk-vendors.css
38+
cp ./table-component/dist/js/app*.js ../js/app.js
39+
cp ./table-component/dist/js/chunk-vendors*.js ../js/chunk-vendors.js
2540
26-
- name: Build documentation.
41+
- name: Prepare documentation
2742
run: |
2843
mkdir gh-pages
2944
touch gh-pages/.nojekyll
@@ -35,4 +50,4 @@ jobs:
3550
with:
3651
branch: gh-pages
3752
force: true
38-
folder: gh-pages
53+
folder: gh-pages

0 commit comments

Comments
 (0)
Please sign in to comment.