|
1 | 1 | name: UI Publish |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_call: |
| 4 | + workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | version_tag: |
7 | 7 | description: 'Version tag to publish under (e.g., b1234)' |
8 | 8 | required: true |
9 | 9 | type: string |
10 | | - secrets: |
11 | | - hf_token: |
12 | | - description: 'Hugging Face token with write access' |
13 | | - required: true |
14 | 10 |
|
15 | 11 | jobs: |
16 | | - build: |
17 | | - name: Build static output |
18 | | - uses: ./.github/workflows/ui-build.yml |
19 | | - |
20 | 12 | publish: |
21 | 13 | name: Publish UI Static Output |
22 | | - needs: build |
23 | | - runs-on: ubuntu-24.04-arm |
| 14 | + runs-on: ubuntu-slim |
24 | 15 |
|
25 | 16 | permissions: |
26 | 17 | contents: read |
27 | 18 |
|
28 | 19 | env: |
29 | | - HF_BUCKET_NAME: ${{ vars.HF_BUCKET_UI_STATIC_OUTPUT }} |
| 20 | + HF_BUCKET_NAME: llama-ui |
30 | 21 |
|
31 | 22 | steps: |
32 | 23 | - name: Checkout code |
33 | 24 | uses: actions/checkout@v6 |
34 | 25 | with: |
35 | 26 | fetch-depth: 1 |
36 | 27 |
|
37 | | - - name: Download UI build artifact |
38 | | - uses: actions/download-artifact@v7 |
39 | | - with: |
40 | | - name: ui-build |
41 | | - path: build/tools/ui/dist/ |
42 | | - |
43 | 28 | - name: Install Hugging Face Hub CLI |
44 | 29 | run: pip install -U huggingface_hub |
45 | 30 |
|
46 | | - - name: Authenticate with Hugging Face |
47 | | - run: hf auth login --token ${{ secrets.hf_token }} |
48 | | - |
49 | | - - name: Sync built files to Hugging Face bucket (version tag) |
50 | | - run: | |
51 | | - # Upload the built files to the Hugging Face bucket under the release version |
52 | | - hf buckets sync build/tools/ui/dist hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/${{ inputs.version_tag }} --delete --quiet |
53 | | -
|
54 | | - - name: Sync built files to Hugging Face bucket (latest) |
55 | | - run: | |
56 | | - # Also upload to the 'latest' directory for fallback downloads |
57 | | - hf buckets sync build/tools/ui/dist hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/latest --delete --quiet |
58 | | -
|
59 | 31 | - name: Verify upload |
60 | 32 | run: | |
61 | 33 | # List the files in the bucket to verify the upload |
62 | 34 | hf buckets list hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/${{ inputs.version_tag }} -R -h |
63 | | -
|
64 | | - - name: Clean up root-level files |
65 | | - run: | |
66 | | - # Clean up any old root-level files from previous non-versioned deployments |
67 | | - hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/index.html --yes 2>/dev/null || true |
68 | | - hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/bundle.js --yes 2>/dev/null || true |
69 | | - hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/bundle.css --yes 2>/dev/null || true |
70 | | - hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/loading.html --yes 2>/dev/null || true |
0 commit comments