Skip to content

Commit

Permalink
Cloudflare migration (#9206)
Browse files Browse the repository at this point in the history
* cloudflare packages

* cloudflare github action

* remove comment

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
aliabd and gradio-pr-bot authored Aug 29, 2024
1 parent 2daf3d1 commit bdbcf7b
Show file tree
Hide file tree
Showing 4 changed files with 634 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/curly-bottles-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"website": patch
---

feat:Cloudflare migration
18 changes: 18 additions & 0 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion js/_website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Loading

0 comments on commit bdbcf7b

Please sign in to comment.