1010 have the "normal" scenario involving checking out a merge commit between your branch and the base branch.
1111 If you want to run only on a branch or specific commit, you can use either the sha or the branch name instead (prefer the first verion for PRs).
1212 required : false
13+ build_web_tools :
14+ description : Whether to build web tools
15+ required : false
16+ default : true
17+ build_native_storybook :
18+ description : Whether to native storybook
19+ required : false
20+ default : true
21+ build_react_storybook :
22+ description : Whether to react storybook
23+ required : false
24+ default : true
1325
1426permissions :
1527 id-token : write
1628 contents : read
1729
1830jobs :
31+
1932 build-web-tools :
20- name : " Web Tools Build"
2133 env :
22- NODE_OPTIONS : " --max-old-space-size=7168"
23- FORCE_COLOR : 3
24- runs-on : ubuntu-22.04
34+ VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
35+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
36+ name : " Web Tools Build"
37+ if : ${{ inputs.build_web_tools != 'false' }}
38+ runs-on : ubuntu-24.04
2539 steps :
2640 - uses : actions/checkout@v4
2741 with :
2842 ref : ${{ inputs.ref || github.sha }}
43+
2944 - name : Setup the caches
3045 uses : LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
3146 id : setup-caches
@@ -36,52 +51,91 @@ jobs:
3651 roleName : ${{ secrets.AWS_CACHE_ROLE_NAME }}
3752 region : ${{ secrets.AWS_CACHE_REGION }}
3853 turbo-server-token : ${{ secrets.TURBOREPO_SERVER_TOKEN }}
54+
55+ - name : Vercel build test
56+ run : npx vercel build
57+ env :
58+ TURBO_TEAM : " foo"
59+ TURBO_TOKEN : ${{ secrets.TURBOREPO_SERVER_TOKEN }}
60+ TURBO_API : http://127.0.0.1:${{ steps.setup-caches.outputs.port }}
61+ VERCEL_ORG_ID : ${{ secrets.VERCEL_LEDGER_WALLET_TEAM_ID }}
62+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_WEBTOOLS }}
63+
64+ - name : Exit
65+ run : |
66+ exit 1
67+
3968 - name : Install dependencies
4069 run : pnpm i -F "web-tools..." -F "ledger-live"
41- - name : build web-tools
42- run : pnpm turbo run build --filter="@ledgerhq/web-tools" --api="http://127.0.0.1:${{ steps.setup-caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
43- - name : typecheck web-tools
70+
71+ - name : Typecheck web-tools
4472 run : pnpm turbo run typecheck --filter="@ledgerhq/web-tools" --api="http://127.0.0.1:${{ steps.setup-caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
4573
46- report :
47- needs : build-web-tools
48- name : " Web Tools Build > Report"
49- if : ${{ !cancelled() && github.event_name == 'workflow_dispatch' }}
50- runs-on : ubuntu-22.04
74+ - name : Vercel build test
75+
76+ - name : Build web-tools
77+ run : pnpm turbo run build --filter="@ledgerhq/web-tools" --api="http://127.0.0.1:${{ steps.setup-caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
78+
79+ - name : Prepare directory
80+ run : |
81+ mkdir -p .vercel/output/static
82+ cp -r dist/* .vercel/output/static
83+ cp vercel_prebuilt_config.json .vercel/output/config.json
84+ working-directory : apps/web-tools
85+
86+ - name : Deploy
87+ run : DEPLOYMENT_URL=$(npx vercel deploy --prebuilt --yes)
88+ env :
89+ VERCEL_TOKEN : ${{ secrets.VERCEL_LEDGER_WALLET_TOKEN }}
90+ VERCEL_ORG_ID : ${{ secrets.VERCEL_LEDGER_WALLET_TEAM_ID }}
91+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_WEBTOOLS }}
92+
93+ working-directory : apps/web-tools
94+
95+ build-native-storybook :
96+ name : " Native Storybook Build"
97+ if : ${{ inputs.build_native_storybook != 'false' }}
98+ runs-on : ubuntu-24.04
5199 steps :
52- - uses : actions/download-artifact@v4
53- with :
54- pattern : outputs-*
55- merge-multiple : true
56- path : outputs
57- - uses : actions/github-script@v6
58- name : build summary
100+ - uses : actions/checkout@v4
101+
102+ - name : Setup the caches
103+ uses : LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
104+ id : caches
59105 with :
60- script : |
61- const fs = require("fs");
62- const statuses = {
63- tool: {
64- pass: ${{ needs.build-web-tools.result == 'success' }},
65- status: "${{ needs.build-web-tools.result }}",
66- }
67- };
68-
69- const summary = `### Web Tools
70-
71- ${statuses.tool.pass ? "Web Tools are fine" : "Web Tools build or typecheck failed"}
72- - ${statuses.tool.pass ? "✅" : "❌"} **Web Tools** ended with status \`${statuses.tool.status}\`
73- `;
74-
75- const actions = [];
76-
77- const output = {
78- summary,
79- actions
80- };
81-
82- fs.writeFileSync("summary-web-tools.json", JSON.stringify(output), "utf-8");
83- - uses : actions/upload-artifact@v4
84- name : Upload output
106+ install-proto : " true"
107+ skip-turbo-cache : " false"
108+ accountId : ${{ secrets.AWS_ACCOUNT_ID_PROD }}
109+ roleName : ${{ secrets.AWS_CACHE_ROLE_NAME }}
110+ region : ${{ secrets.AWS_CACHE_REGION }}
111+ turbo-server-token : ${{ secrets.TURBOREPO_SERVER_TOKEN }}
112+
113+ - name : Install dependencies
114+ run : pnpm i -F "@ledgerhq/native-ui..." -F "ledger-live"
115+
116+ - name : Build storybook
117+ run : pnpm turbo run build:storybook --filter="@ledgerhq/native-ui" --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
118+
119+ build-react-storybook :
120+ name : " React Storybook Build"
121+ if : ${{ inputs.build_react_storybook != 'false' }}
122+ runs-on : ubuntu-24.04
123+ steps :
124+ - uses : actions/checkout@v4
125+
126+ - name : Setup the caches
127+ uses : LedgerHQ/ledger-live/tools/actions/composites/setup-caches@develop
128+ id : caches
85129 with :
86- path : ${{ github.workspace }}/summary-web-tools.json
87- name : summary-web-tools.json
130+ install-proto : " true"
131+ skip-turbo-cache : " false"
132+ accountId : ${{ secrets.AWS_ACCOUNT_ID_PROD }}
133+ roleName : ${{ secrets.AWS_CACHE_ROLE_NAME }}
134+ region : ${{ secrets.AWS_CACHE_REGION }}
135+ turbo-server-token : ${{ secrets.TURBOREPO_SERVER_TOKEN }}
136+
137+ - name : Install dependencies
138+ run : pnpm i -F "./libs/ui/**" -F "ledger-live"
139+
140+ - name : Build storybook
141+ run : pnpm turbo run build:storybook --filter="@ledgerhq/react-ui" --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
0 commit comments