Skip to content

Commit a9c706c

Browse files
authored
feat: test web use with ghpage (#73)
* feat: test web use with ghpage * fix: fix url * fix: update url * fix: add verify * fix: cname * fix: add cname
1 parent a323428 commit a9c706c

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/release-web.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,71 @@ on:
44
workflow_dispatch:
55

66
jobs:
7+
test-web:
8+
runs-on: ubuntu-latest
9+
env:
10+
TEST_ENDPOINT: firmware.onekeytest.com
11+
PUBLIC_URL: "https://firmware.onekeytest.com/"
12+
NODE_ENV: "production"
13+
CI: false
14+
if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }}
15+
steps:
16+
- name: Checkout Source Code
17+
uses: actions/checkout@v3
18+
with:
19+
lfs: true
20+
- name: Setup Environment
21+
uses: actions/setup-node@v3
22+
with:
23+
registry-url: "https://npm.pkg.github.com"
24+
always-auth: true
25+
scope: "@onekeyhq"
26+
node-version: "16.x"
27+
28+
- name: Install Dependency
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: |
32+
yarn
33+
34+
- name: Build Target
35+
env:
36+
PUBLIC_URL: ${{ env.PUBLIC_URL }}
37+
NODE_OPTIONS: "--max_old_space_size=4096"
38+
CI: false
39+
run: |
40+
echo "Starting build process..."
41+
echo "PUBLIC_URL: $PUBLIC_URL"
42+
echo "NODE_ENV: $NODE_ENV"
43+
echo "CI: $CI"
44+
yarn build
45+
echo "Build process completed"
46+
47+
- name: Verify Build Output
48+
run: |
49+
echo "Checking build directory..."
50+
ls -la ./
51+
if [ -d "./build" ]; then
52+
echo "✅ Build directory exists"
53+
echo "Build directory contents:"
54+
ls -la ./build/
55+
echo "Build directory size:"
56+
du -sh ./build/
57+
else
58+
echo "❌ Build directory does not exist!"
59+
echo "Current directory contents:"
60+
ls -la ./
61+
exit 1
62+
fi
63+
64+
- name: Deploy Github Pages
65+
uses: OneKeyHQ/actions/gh-pages@main
66+
with:
67+
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
publish_dir: ./build
69+
cname: ${{ env.TEST_ENDPOINT }}
70+
force_orphan: true
71+
772
release-web:
873
runs-on: ubuntu-latest
974
env:

0 commit comments

Comments
 (0)