Workflow file for this run
This file contains 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
# This workflow will check if the run.py files in every demo match the run.ipynb notebooks. | ||
name: Upload Website Demos to Spaces | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: closed | ||
branches: | ||
- main | ||
jobs: | ||
upload-wheel-aws: | ||
if: github.event.pull_request.merged == true || github.event.action == '' | ||
name: Upload Demos | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- name: Install pip | ||
run: python -m pip install build requests | ||
- name: Build Wheel | ||
run: | | ||
pip install . && python -m build -w | ||
- name: Upload Wheel to AWS | ||
run: | | ||
export AWS_ACCESS_KEY_ID=${{ secrets.PR_DEPLOY_KEY }} | ||
export AWS_SECRET_ACCESS_KEY=${{ secrets.PR_DEPLOY_SECRET }} | ||
export AWS_DEFAULT_REGION=us-east-1 | ||
export LATEST_COMMIT=$(git log -1 --format="%H") | ||
aws s3 cp dist/gradio-*-py3-none-any.whl s3://gradio-builds/$LATEST_COMMIT/ | ||
- name: Install Hub Client Library | ||
run: pip install huggingface-hub | ||
- name: Upload Demos to Spaces | ||
run: | | ||
export AUTH_TOKEN=${{ secrets.SPACES_DEPLOY_TOKEN }} | ||
python scripts/upload_website_demos.py --WHEEL_URL s3://gradio-builds/$LATEST_COMMIT/ |