adf0d17497
publish / version_or_publish (push) Has been cancelled
storybook-build / changes (push) Has been cancelled
storybook-build / :storybook-build (push) Has been cancelled
Sync Gradio Skills to Hugging Face / sync-skills (push) Has been cancelled
functional / changes (push) Has been cancelled
functional / build-frontend (push) Has been cancelled
functional / functional-test-SSR=false (push) Has been cancelled
functional / functional-reload (push) Has been cancelled
js / changes (push) Has been cancelled
js / js-test (push) Has been cancelled
docs-build / changes (push) Has been cancelled
docs-build / docs-build (push) Has been cancelled
docs-build / website-build (push) Has been cancelled
functional / functional-test-SSR=true (push) Has been cancelled
hygiene / hygiene-test (push) Has been cancelled
python / changes (push) Has been cancelled
python / build (push) Has been cancelled
python / test-ubuntu-latest-flaky (push) Has been cancelled
python / test-ubuntu-latest-not-flaky (push) Has been cancelled
python / test-windows-latest-flaky (push) Has been cancelled
python / test-windows-latest-not-flaky (push) Has been cancelled
107 lines
3.6 KiB
YAML
107 lines
3.6 KiB
YAML
name: "website-deploy"
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["website-build"]
|
|
types:
|
|
- completed
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
changes:
|
|
if: github.event.workflow_run.conclusion == 'success'
|
|
name: "changes"
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: read
|
|
outputs:
|
|
should_run: ${{ steps.json.outputs.should_run }}
|
|
sha: ${{ steps.json.outputs.sha }}
|
|
pr_number: ${{ steps.json.outputs.pr_number }}
|
|
source_branch: ${{ steps.json.outputs.source_branch }}
|
|
source_repo: ${{ steps.json.outputs.source_repo }}
|
|
labels: ${{ steps.json.outputs.labels }}
|
|
run_id: ${{ steps.json.outputs.run_id }}
|
|
steps:
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: changes
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
- uses: gradio-app/github/actions/json-to-output@main
|
|
id: json
|
|
with:
|
|
path: output.json
|
|
comment-deploy-start:
|
|
needs: changes
|
|
uses: "./.github/workflows/comment-queue.yml"
|
|
if: needs.changes.outputs.should_run == 'true'
|
|
secrets:
|
|
gh_token: ${{ secrets.COMMENT_TOKEN }}
|
|
with:
|
|
pr_number: ${{ needs.changes.outputs.pr_number }}
|
|
message: website~pending~null
|
|
deploy:
|
|
environment: deploy_website
|
|
name: "website-deploy"
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: needs.changes.outputs.should_run == 'true' || (endsWith(needs.changes.outputs.source_branch, 'main') && github.repository == 'gradio-app/gradio')
|
|
permissions:
|
|
actions: read
|
|
outputs:
|
|
cloudflare_url: ${{ steps.cloudflare-preview.outputs.deployment-url }}
|
|
steps:
|
|
- name: download website artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: website
|
|
path: js/_website
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# preview
|
|
- name: Deploy Preview Worker to Cloudflare
|
|
if: needs.changes.outputs.pr_number != 'false'
|
|
id: cloudflare-preview
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
workingDirectory: js/_website
|
|
wranglerVersion: "4"
|
|
command: versions upload
|
|
|
|
# production
|
|
- name: Deploy Production Worker to Cloudflare
|
|
if: needs.changes.outputs.source_repo == 'gradio-app/gradio' && needs.changes.outputs.source_branch == 'refs/heads/main'
|
|
id: cloudflare-production
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
workingDirectory: js/_website
|
|
wranglerVersion: "4"
|
|
command: deploy
|
|
|
|
comment-deploy-success:
|
|
uses: "./.github/workflows/comment-queue.yml"
|
|
needs: [deploy, changes]
|
|
if: needs.deploy.result == 'success' && needs.changes.outputs.pr_number != 'false'
|
|
secrets:
|
|
gh_token: ${{ secrets.COMMENT_TOKEN }}
|
|
with:
|
|
pr_number: ${{ needs.changes.outputs.pr_number }}
|
|
message: website~success~${{needs.deploy.outputs.cloudflare_url}}
|
|
comment-deploy-failure:
|
|
uses: "./.github/workflows/comment-queue.yml"
|
|
needs: [deploy, changes]
|
|
if: always() && needs.deploy.result == 'failure' && needs.changes.outputs.pr_number != 'false'
|
|
secrets:
|
|
gh_token: ${{ secrets.COMMENT_TOKEN }}
|
|
with:
|
|
pr_number: ${{ needs.changes.outputs.pr_number }}
|
|
message: website~failure~https://github.com/gradio-app/gradio/actions/runs/${{github.run_id}}/
|