Cloudflare migration (#9206)

* cloudflare packages

* cloudflare github action

* remove comment

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Ali Abdalla 2024-08-28 18:07:38 -07:00 committed by GitHub
parent 2daf3d10f5
commit bdbcf7b0e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 634 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"website": patch
---
feat:Cloudflare migration

View File

@ -78,6 +78,15 @@ jobs:
shell: bash
run: echo "vercel_url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_DEPLOY_TOKEN }} --cwd js/_website)" >> $GITHUB_OUTPUT
- name: Deploy Preview Website to Cloudflare Pages
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 }}
command: pages deploy js/_website/build/ --project-name=gradio-website
# production
- name: Pull Vercel Environment Information
if: needs.changes.outputs.source_repo == 'gradio-app/gradio' && needs.changes.outputs.source_branch == 'refs/heads/main'
@ -89,6 +98,15 @@ jobs:
shell: bash
run: echo "VERCEL_URL=$(vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_DEPLOY_TOKEN }} --cwd js/_website)" >> $GITHUB_ENV
- name: Deploy Production Website to Cloudflare Pages
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 }}
command: pages deploy js/_website/build/ --project-name=gradio-website --branch=main
comment-deploy-success:
uses: "./.github/workflows/comment-queue.yml"
needs: [deploy, changes]

View File

@ -30,6 +30,7 @@
"hast-util-to-string": "^3.0.0",
"mdsvex": "^0.11.0",
"postcss": "^8.4.27",
"prism-svelte": "^0.5.0"
"prism-svelte": "^0.5.0",
"wrangler": "^3.72.3"
}
}

File diff suppressed because it is too large Load Diff