File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 3333 uses : actions/checkout@v4
3434 - name : Setup Pages
3535 uses : actions/configure-pages@v5
36+ - name : Build index-final.html
37+ run : |
38+ python build.py
3639 - name : Upload artifact
3740 uses : actions/upload-pages-artifact@v3
3841 with :
Original file line number Diff line number Diff line change 1+ # build.py
2+ html = open ('index.html' ).read ()
3+ css = open ('style.css' ).read ()
4+ js = open ('app.js' ).read ()
5+
6+ # Zakładam, że index.html ma <head>...</head> i </body>
7+ # Dodaj CSS do <head>
8+ html = html .replace (
9+ '</head>' ,
10+ f'<style>\n { css } \n </style>\n </head>'
11+ )
12+ # Dodaj JS na końcu przed </body>
13+ html = html .replace ('<script src="app.js"></script>' ,'' );
14+ html = html .replace (
15+ '</body>' ,
16+ f'<script>\n { js } \n </script>\n </body>'
17+ )
18+
19+ with open ('index-final.html' , 'w' ) as f :
20+ f .write (html )
You can’t perform that action at this time.
0 commit comments