-
Notifications
You must be signed in to change notification settings - Fork 106
104 lines (94 loc) · 3.74 KB
/
web-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Tonkeeper Web Build
on:
workflow_call:
inputs:
environment:
required: true
type: string
secrets:
REACT_APP_AMPLITUDE_EXTENSION:
required: true
REACT_APP_MEASUREMENT_ID:
required: true
VITE_APP_APTABASE:
required: true
REACT_APP_TG_BOT_ID:
required: true
REACT_APP_STONFI_REFERRAL_ADDRESS:
required: true
CLOUDFLARE_API_TOKEN:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true
outputs:
deployment-url:
description: 'The app deployment url'
value: ${{ jobs.web-build.outputs.deployment-url }}
env:
node-version: 20.11.1
jobs:
web-build:
name: web-build
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
deployment-url: ${{ steps.deploy.outputs.deployment-url }}
steps:
- name: Checkout to git repository
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Enable Corepack
run: |
corepack enable
- name: Yarn cache
uses: actions/cache@v4
with:
path: ./.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Run install
uses: borales/actions-yarn@v5
with:
cmd: install
- name: Run build
uses: borales/actions-yarn@v5
env:
VITE_APP_AMPLITUDE: ${{ secrets.REACT_APP_AMPLITUDE_EXTENSION }}
VITE_APP_MEASUREMENT_ID: ${{ secrets.REACT_APP_MEASUREMENT_ID }}
VITE_APP_APTABASE: ${{ secrets.VITE_APP_APTABASE }}
VITE_APP_APTABASE_HOST: https://anonymous-analytics.tonkeeper.com
VITE_APP_LOCALES: en,zh_TW,zh_CN,id,ru,it,es,uk,tr,bg,uz,bn
VITE_APP_TONCONSOLE_HOST: https://pro.tonconsole.com
VITE_APP_TG_BOT_ID: ${{ secrets.REACT_APP_TG_BOT_ID }}
VITE_APP_STONFI_REFERRAL_ADDRESS: ${{ secrets.REACT_APP_STONFI_REFERRAL_ADDRESS }}
with:
cmd: build:web
- name: Publish to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command:
pages deploy apps/web/dist --project-name=tonkeeper-web --branch=${{
inputs.environment }}
- name: Summary
run: |
echo '### Successful WEB deployment 🚀🚀🚀' >> $GITHUB_STEP_SUMMARY
echo 'Well done!' >> $GITHUB_STEP_SUMMARY
echo 'Link to test environment:' >> $GITHUB_STEP_SUMMARY
echo '${{ steps.deploy.outputs.deployment-url }}' >> $GITHUB_STEP_SUMMARY
- name: Comment PR
uses: thollander/actions-comment-pull-request@v3
if: github.event_name == 'pull_request'
with:
message: |
### Successful WEB deployment 🚀🚀🚀
Well done!
Link to test environment:
${{ steps.deploy.outputs.deployment-url }}
comment-tag: web_deploy