add lite upload (#9385)

This commit is contained in:
Ali Abdalla 2024-09-19 00:44:24 +04:00 committed by GitHub
parent 0cad5f348a
commit 832d1d6497
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,7 +94,15 @@ jobs:
export AWS_DEFAULT_REGION=us-east-1
aws s3 cp ${{ steps.set_tarball_name.outputs.tarball_path }} s3://gradio-npm-previews/${{ needs.changes.outputs.sha }}/
echo "js_tarball_url=https://gradio-npm-previews.s3.amazonaws.com/${{ needs.changes.outputs.sha }}/${{ steps.set_tarball_name.outputs.tarball_name }}" >> $GITHUB_OUTPUT
- name: Upload Lite to S3
id: upload_lite
run: |
export AWS_ACCESS_KEY_ID=${{ secrets.LITE_PREVIEWS_AWS_S3_ACCESS_KEY }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.LITE_PREVIEWS_AWS_S3_SECRET_ACCESS_KEY }}
export AWS_DEFAULT_REGION=us-east-1
mkdir -p ./gradio-lite-files
tar -xzf ./gradio-lite-${{ needs.changes.outputs.sha }}/gradio-lite-*.tgz -C ./gradio-lite-files
aws s3 cp ./gradio-lite-files/package/ s3://gradio-lite-previews/${{ needs.changes.outputs.sha }}/ --recursive
- name: Install Hub Client Library
run: pip install huggingface-hub==0.23.2
# temporary, but ensures the script cannot be modified in a PR
@ -147,6 +155,11 @@ jobs:
```bash
npm install ${{ needs.deploy.outputs.js_tarball_url }}
```
**Use Lite from this PR**
```html
<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/${{ needs.changes.outputs.sha }}/dist/lite.js""></script>
```
comment-spaces-failure:
uses: "./.github/workflows/comment-queue.yml"
needs: [deploy, changes]