File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,19 @@ jobs:
7575 wrangler_main=$(docker run -i ghcr.io/pelletier/go-toml:v2 tomljson < wrangler.toml | jq -r '.main')
7676 echo "WRANGLER_MAIN=${wrangler_main}" >> "$GITHUB_OUTPUT"
7777
78+ - name : Check for [build] field in wrangler.toml
79+ id : check-custom-build
80+ working-directory : ${{ github.event.inputs.directory }}
81+ run : |
82+ CUSTOM_BUILD=$(docker run -i ghcr.io/pelletier/go-toml:v2 tomljson < wrangler.toml | jq -e '.build' > /dev/null && echo "true" || echo "false")
83+ echo "CUSTOM_BUILD=${CUSTOM_BUILD}" >> "$GITHUB_OUTPUT"
84+
7885 - name : Bundle/Build Worker
7986 uses : cloudflare/wrangler-action@v3
8087 with :
8188 wranglerVersion : ${{ env.wranglerVersion }}
8289 workingDirectory : ${{ github.event.inputs.directory }}
83- command : deploy --dry-run -- outdir=${{ env.outDir }} --name=${{ github.event.inputs.appId }} --dispatch-namespace ${{ github.event.inputs.dispatchNamespace }}
90+ command : deploy --dry-run ${{ steps.check-custom-build.outputs.CUSTOM_BUILD == 'false' && format('-- outdir={0}', env.outDir) || '' }} --name=${{ github.event.inputs.appId }} --dispatch-namespace ${{ github.event.inputs.dispatchNamespace }}
8491
8592 - name : Deploy Worker
8693 uses : cloudflare/wrangler-action@v3
8996 accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
9097 wranglerVersion : ${{ env.wranglerVersion }}
9198 workingDirectory : ${{ github.event.inputs.directory }}
92- command : deploy --no-bundle --name=${{ github.event.inputs.appId }} --dispatch-namespace ${{ github.event.inputs.dispatchNamespace }} ${{ env.outDir }}/ ${{ steps.wrangler-main.outputs.WRANGLER_MAIN }}
99+ command : deploy --no-bundle --name=${{ github.event.inputs.appId }} --dispatch-namespace ${{ github.event.inputs.dispatchNamespace }} ${{ steps.check-custom-build.outputs.CUSTOM_BUILD == 'false' && format('{0}/', env.outDir) || '' }} ${{ steps.wrangler-main.outputs.WRANGLER_MAIN }}
You can’t perform that action at this time.
0 commit comments