7777
7878 sync-locale :
7979 runs-on : ubuntu-24.04
80+ if : |
81+ github.event_name == 'push' &&
82+ contains(github.event.commits.*.added, 'locale') ||
83+ contains(github.event.commits.*.modified, 'locale') ||
84+ contains(github.event.commits.*.removed, 'locale')
8085 strategy :
8186 matrix :
8287 node-version : [18.x]
@@ -95,3 +100,44 @@ jobs:
95100 folder : locale
96101 clean : false
97102 commit-message : ' [skip ci] sync locale'
103+
104+ build-docs :
105+ runs-on : ubuntu-24.04
106+ if : |
107+ github.event_name == 'push' &&
108+ contains(github.event.commits.*.added, 'docs') ||
109+ contains(github.event.commits.*.modified, 'docs') ||
110+ contains(github.event.commits.*.removed, 'docs')
111+ strategy :
112+ matrix :
113+ node-version : [18.x]
114+ steps :
115+ - uses : actions/checkout@v4
116+ - uses : pnpm/action-setup@v4
117+ with :
118+ version : 9
119+ - name : Use Node.js ${{ matrix.node-version }}
120+ uses : actions/setup-node@v4
121+ with :
122+ node-version : ${{ matrix.node-version }}
123+ - name : Install dependencies
124+ run : |
125+ cd $GITHUB_WORKSPACE/docs
126+ pnpm i
127+ - name : Build
128+ run : |
129+ cd $GITHUB_WORKSPACE/docs
130+ npm run build
131+ cp $GITHUB_WORKSPACE/scripts/www/* $GITHUB_WORKSPACE/docs/dist/
132+ - name : Deploy Cloudflare Pages
133+ uses : cloudflare/wrangler-action@v3
134+ with :
135+ apiToken : ${{ secrets.CF_API_TOKEN }}
136+ accountId : ${{ secrets.CF_ACCOUNT_ID }}
137+ command : pages deploy docs/dist --project-name=${{ vars.CF_PAGE_NAME }} --branch=dev
138+ - name : Deploy EdgeOne Pages
139+ env :
140+ EO_PAGE_TOKEN : ${{ secrets.EO_PAGE_TOKEN }}
141+ run : |
142+ npm i -g edgeone
143+ edgeone pages deploy $GITHUB_WORKSPACE/docs/dist -n ${{ vars.EO_PAGE_NAME }} -t $EO_PAGE_TOKEN -e preview
0 commit comments