feat(wrangler): migrate to Wrangler 2 [deploy]

This commit is contained in:
Harsh Shandilya 2022-08-26 12:22:53 +05:30
parent a8828658b4
commit 4c4d9d4680
2 changed files with 11 additions and 5 deletions

View File

@ -33,13 +33,15 @@ jobs:
- name: Build Hugo Site
shell: bash
run: |
yarn install
hugo --minify --gc
- name: Publish to Cloudflare Workers Sites
uses: cloudflare/wrangler-action@1.3.0
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'production'
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: publish --env production
env:
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
@ -71,11 +73,14 @@ jobs:
- name: Build Hugo Site
shell: bash
run: |
yarn install
hugo --minify --gc -D --baseUrl 'https://drafts.msfjarvis.dev/'
- name: Publish to Cloudflare Workers Sites
uses: cloudflare/wrangler-action@1.3.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: publish
env:
CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}

View File

@ -1,6 +1,4 @@
name = "msfjarvis-dev-staging"
type = "webpack"
webpack_config = "webpack.config.js"
workers_dev = false
route = "drafts.msfjarvis.dev/*"
vars = { BASE_URL = "https://drafts.msfjarvis.dev/" }
@ -8,10 +6,13 @@ compatibility_date = "2021-11-08"
kv_namespaces = [
{ binding = "NAMESPACE", id = "43d755465f4642ccb30b1bdce031d1da" }
]
main = "dist/worker.production.js"
[build]
command = "yarn run build"
[site]
bucket = "./public"
entry-point = "workers-site"
[env.production]
name = "msfjarvis-dev-prod"