Skip to content

Commit

Permalink
Move to Workers (cloudflare#17502)
Browse files Browse the repository at this point in the history
* Move to Workers

* Add a thing to force a trailing slash for redirect evaluation

* Standardize _redirects

* Add tests (cloudflare#17503)

* Exclude tests from typechecking
  • Loading branch information
GregBrimble authored Oct 15, 2024
1 parent 81cbf7e commit 9159acf
Show file tree
Hide file tree
Showing 15 changed files with 2,330 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ jobs:

- name: Check - Validate redirects (infinite loops, sources with fragment)
run: npx tsm bin/validate-redirects.ts

- name: Tests
run: npm run test
4 changes: 2 additions & 2 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04
permissions:
contents: read
name: Publish to Cloudflare Pages (Preview)
name: Publish Preview
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -35,7 +35,7 @@ jobs:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- run: npm run build:worker && npx wrangler versions upload -c ./wrangler-workers.toml
name: Deploy to Cloudflare Workers [preview]
name: Deploy to Cloudflare Workers
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- uses: actions/cache/save@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/publish-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-22.04
permissions:
contents: read
name: Publish to Cloudflare Pages (Production)
name: Publish Production
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -30,6 +30,10 @@ jobs:
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- run: npx wrangler deploy -c ./wrangler-workers.toml
name: Deploy to Cloudflare Workers
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- uses: actions/cache/save@v4
if: always()
with:
Expand Down
Loading

0 comments on commit 9159acf

Please sign in to comment.