release-web #75
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ |