File tree Expand file tree Collapse file tree 5 files changed +5
-17
lines changed
Expand file tree Collapse file tree 5 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ name: Publish dist to GitHub Pages (per-branch, no build)
33on :
44 push :
55 branches :
6- - ' **' # все ветки
7- delete : # опциональная очистка при удалении веток (см. второй job ниже)
6+ - ' **'
7+ delete :
88
99permissions :
1010 contents : write
2222 id : vars
2323 run : |
2424 BRANCH="${GITHUB_REF_NAME}"
25- # нормализуем: заменяем слеши и пробелы на '-', нижний регистр, фильтруем лишнее
2625 SLUG="$(printf '%s' "$BRANCH" \
2726 | tr '[:upper:]' '[:lower:]' \
2827 | sed -E 's#[/ ]+#-#g; s#[^a-z0-9._-]#-#g; s#-+#-#g; s#(^-|-$)##g')"
@@ -35,17 +34,15 @@ jobs:
3534 exit 1
3635 fi
3736
38- # main --> корень gh-pages. ВАЖНО: clean=false, чтобы не снести подпапки других веток.
3937 - name : Deploy main to root
4038 if : steps.vars.outputs.slug == 'main'
4139 uses : JamesIves/github-pages-deploy-action@v4
4240 with :
4341 token : ${{ secrets.GITHUB_TOKEN }}
4442 branch : gh-pages
4543 folder : dist
46- clean : false # не чистим весь корень, сохраняем подпапки других веток
44+ clean : false
4745
48- # другие ветки --> gh-pages/<branch>
4946 - name : Deploy branch to subfolder
5047 if : steps.vars.outputs.slug != 'main'
5148 uses : JamesIves/github-pages-deploy-action@v4
5451 branch : gh-pages
5552 folder : dist
5653 target-folder : ${{ steps.vars.outputs.slug }}
57- clean : true # чистим ТОЛЬКО свою подпапку
54+ clean : true
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ export const Footer = () => {
1414 const [ skipRedirect , setSkipRedirect ] = useState ( 'ios' ) ;
1515 const [ featuresType , setFeaturesType ] = useState < 'none' | 'required' | 'preferred' > ( 'none' ) ;
1616
17- // Состояния для features
1817 const [ useSendTransaction , setUseSendTransaction ] = useState ( false ) ;
1918 const [ useSignData , setUseSignData ] = useState ( false ) ;
2019 const [ useSubscription , setUseSubscription ] = useState ( false ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import { createRoot } from 'react-dom/client';
66import App from './App' ;
77import './index.scss' ;
88
9- // Загружаем eruda только в dev режиме
109if ( import . meta. env . DEV ) {
1110 import ( 'eruda' ) . then ( ( { default : eruda } ) => {
1211 eruda . init ( ) ;
Original file line number Diff line number Diff line change 1- // Гарантируем глобальный Buffer/alloc и др. методы в браузере
21import { Buffer as BufferPolyfill } from 'buffer'
32import process from 'process'
43
@@ -8,7 +7,6 @@ if (!g.Buffer || typeof g.Buffer.alloc !== 'function') {
87 g . Buffer = BufferPolyfill
98}
109
11- // если нужен process.env и т.п. (безопасно оставить)
1210if ( ! g . process ) {
1311 g . process = process
1412}
Original file line number Diff line number Diff line change @@ -7,32 +7,27 @@ import { copyFileSync } from 'node:fs'
77import { resolve } from 'node:path'
88
99function getBranch ( ) {
10- // 1) приоритет у BRANCH_NAME (если передан из CI)
1110 if ( process . env . BRANCH_NAME ) return process . env . BRANCH_NAME
1211
13- // 2) локально берём из git
1412 try {
1513 let name = execSync ( 'git rev-parse --abbrev-ref HEAD' , {
1614 stdio : [ 'ignore' , 'pipe' , 'ignore' ] ,
1715 } ) . toString ( ) . trim ( )
1816
19- // если detached HEAD — подставим короткий SHA
2017 if ( name === 'HEAD' ) {
2118 name = execSync ( 'git rev-parse --short HEAD' , {
2219 stdio : [ 'ignore' , 'pipe' , 'ignore' ] ,
2320 } ) . toString ( ) . trim ( )
2421 }
2522 return name
2623 } catch {
27- return 'main' // запасной вариант, если git недоступен
24+ return 'main'
2825 }
2926}
3027
31- // опционально: нормализуем под имя папки на Pages
3228const slugify = ( s : string ) =>
3329 s . toLowerCase ( ) . replace ( / [ / \s ] + / g, '-' ) . replace ( / [ ^ a - z 0 - 9 . _ - ] / g, '-' )
3430
35- // Плагин для создания 404.html для SPA на GitHub Pages
3631function create404Plugin ( ) {
3732 return {
3833 name : 'create-404-html' ,
You can’t perform that action at this time.
0 commit comments