File tree Expand file tree Collapse file tree 4 files changed +94
-0
lines changed Expand file tree Collapse file tree 4 files changed +94
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Deploy Demo
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main # Укажите ветку, которую хотите использовать для деплоя
7
+
8
+ jobs :
9
+ build-and-deploy :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout code
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Set up Node.js
17
+ uses : actions/setup-node@v3
18
+ with :
19
+ node-version : 18
20
+
21
+ - name : Install dependencies
22
+ run : npm install
23
+
24
+ - name : Build demo
25
+ run : npm run build:demo
26
+
27
+ - name : Deploy to GitHub Pages
28
+ uses : peaceiris/actions-gh-pages@v3
29
+ with :
30
+ github_token : ${{ secrets.GITHUB_TOKEN }}
31
+ publish_dir : ./dist/demo
Original file line number Diff line number Diff line change 10
10
"scripts" : {
11
11
"start" : " webpack serve" ,
12
12
"build" : " webpack --mode production" ,
13
+ "build:demo" : " webpack --config demo/webpack.demo.config.js --mode production" ,
13
14
"prepare" : " npm run build"
14
15
},
15
16
"keywords" : [
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < title > < %= htmlWebpackPlugin.options.title %> </ title >
7
+ </ head >
8
+ < body >
9
+ < div id ="tech-particles "> </ div >
10
+ </ body >
11
+ </ html >
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' ) ;
2
+ const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
3
+ const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
4
+
5
+ module . exports = {
6
+ entry : './demo.js' ,
7
+ mode : 'production' ,
8
+ output : {
9
+ filename : 'webgl-tech-particles.demo.js' ,
10
+ path : path . resolve ( __dirname , '../dist/demo' ) ,
11
+ clean : true ,
12
+ } ,
13
+ module : {
14
+ rules : [
15
+ {
16
+ test : / \. j s $ / ,
17
+ exclude : / n o d e _ m o d u l e s / ,
18
+ use : {
19
+ loader : 'babel-loader' ,
20
+ options : {
21
+ presets : [ '@babel/preset-env' ] ,
22
+ } ,
23
+ } ,
24
+ } ,
25
+ {
26
+ test : / \. c s s $ / ,
27
+ use : [ 'style-loader' , 'css-loader' ] ,
28
+ } ,
29
+ {
30
+ test : / \. ( p n g | j p g | g i f | w e b p ) $ / ,
31
+ type : 'asset/resource' ,
32
+ generator : {
33
+ filename : 'assets/icons/[name][ext]' ,
34
+ } ,
35
+ } ,
36
+ ] ,
37
+ } ,
38
+ plugins : [
39
+ new CopyWebpackPlugin ( {
40
+ patterns : [
41
+ { from : '../settings.json' , to : 'settings.json' } ,
42
+ { from : '../src/assets/icons' , to : 'assets/icons' } ,
43
+ ] ,
44
+ } ) ,
45
+ new HtmlWebpackPlugin ( {
46
+ template : './demo.html' ,
47
+ filename : 'demo.html' ,
48
+ title : 'WebGL Tech Particles Demo' ,
49
+ } ) ,
50
+ ] ,
51
+ } ;
You can’t perform that action at this time.
0 commit comments