@@ -26,7 +26,7 @@ concurrency:
2626 cancel-in-progress : true
2727
2828jobs :
29- build :
29+ sync :
3030 name : Deploy to GitHub Pages
3131 runs-on : ubuntu-latest
3232 steps :
4141 with :
4242 fetch-depth : 0
4343
44- - name : Setup Pages
45- uses : actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b
46-
4744 - uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
4845 with :
4946 node-version : 22
@@ -78,13 +75,84 @@ jobs:
7875 env :
7976 GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
8077
81- - name : Build website
82- run : yarn build
78+ - name : Get locales
79+ run : yarn output-locales
80+
81+ - name : Define matrix
82+ id : locales
83+ run : echo "locales=$(cat locales.json)" >> $GITHUB_ENV
84+
85+ build :
86+ runs-on : ubuntu-latest
87+ needs : sync
88+ strategy :
89+ matrix :
90+ locales : ${{ fromJson(needs.sync.outputs.locales) }}
91+ steps :
92+ - uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
93+ with :
94+ node-version : 22
95+
96+ - name : Enable Corepack
97+ run : corepack enable
98+
99+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
100+ with :
101+ fetch-depth : 0
102+
103+ - uses : actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
104+ with :
105+ node-version : 22
106+ cache : yarn
107+
108+ - name : Install dependencies
109+ run : yarn install --immutable
110+
111+ - uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
112+ with :
113+ path : |
114+ ${{ github.workspace }}/.docusaurus
115+ ${{ github.workspace }}/**/.cache
116+ key : |
117+ ${{ runner.os }}-docusaurus-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
118+ restore-keys : |
119+ ${{ runner.os }}-docusaurus-${{ hashFiles('**/yarn.lock') }}
120+
121+ - name : Build Locale
122+ run : yarn build --locale ${{ matrix.locales }}
123+
124+ - name : Upload artifact
125+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1
126+ with :
127+ path : build
128+ name : ${{ matrix.locales }}
129+
130+ combine :
131+ runs-on : ubuntu-latest
132+ needs : build
133+ steps :
134+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
135+ with :
136+ fetch-depth : 0
137+
138+ - name : Setup Pages
139+ uses : actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b
140+
141+ - name : Download artifacts
142+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806
143+ with :
144+ path : build
145+
146+ - name : Move default locale to root build
147+ run : |
148+ mv build/en/* build/
149+ rm -rf build/en
83150
84151 - name : Upload artifact
85152 uses : actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
86153 with :
87154 path : build
155+
88156 deploy :
89157 environment :
90158 name : github-pages
0 commit comments