-
Notifications
You must be signed in to change notification settings - Fork 3
106 lines (96 loc) · 2.82 KB
/
release-web.yml
File metadata and controls
106 lines (96 loc) · 2.82 KB
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
105
106
name: release-web
on:
workflow_dispatch:
jobs:
test-web:
runs-on: ubuntu-latest
env:
TEST_ENDPOINT: firmware.onekeytest.com
PUBLIC_URL: "https://firmware.onekeytest.com/"
NODE_ENV: "production"
CI: false
if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }}
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
lfs: true
- name: Setup Environment
uses: actions/setup-node@v3
with:
registry-url: "https://npm.pkg.github.com"
always-auth: true
scope: "@onekeyhq"
node-version: "16.x"
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn
- name: Build Target
env:
PUBLIC_URL: ${{ env.PUBLIC_URL }}
NODE_OPTIONS: "--max_old_space_size=4096"
CI: false
run: |
echo "Starting build process..."
echo "PUBLIC_URL: $PUBLIC_URL"
echo "NODE_ENV: $NODE_ENV"
echo "CI: $CI"
yarn build
echo "Build process completed"
- name: Verify Build Output
run: |
echo "Checking build directory..."
ls -la ./
if [ -d "./build" ]; then
echo "✅ Build directory exists"
echo "Build directory contents:"
ls -la ./build/
echo "Build directory size:"
du -sh ./build/
else
echo "❌ Build directory does not exist!"
echo "Current directory contents:"
ls -la ./
exit 1
fi
- name: Deploy Github Pages
uses: OneKeyHQ/actions/gh-pages@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
cname: ${{ env.TEST_ENDPOINT }}
force_orphan: true
release-web:
runs-on: ubuntu-latest
env:
PUBLIC_URL: "https://firmware.onekey.so/${{ github.sha }}/"
NODE_ENV: "production"
CI: false
steps:
- uses: actions/checkout@v3
- name: Setup Environment
uses: actions/setup-node@v3
with:
registry-url: "https://npm.pkg.github.com"
always-auth: true
scope: "@onekeyhq"
node-version: "16.x"
- name: Install Dependency
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn
- name: Build Target
env:
PUBLIC_URL: ${{ env.PUBLIC_URL }}
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
yarn build
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: firmware-updater-${{ github.sha }}
path: |
./build/