Deploying Page Functions with Wrangler

When deploying using wrangler, instead of the Git integration, my Page Functions do not get detected I am using the following Github Action
- name: Deploy to Cloudflare Pages
run: |
npx wrangler pages deploy ${{ github.workspace }}/blazorapp/wwwroot --project-name=${{ inputs.project-name }} --branch=${{ inputs.branch-name }}
shell: bash
env:
CLOUDFLARE_API_TOKEN: ${{ inputs.cloudflare-api-token }}
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.cloudflare-account-id }}
- name: Deploy to Cloudflare Pages
run: |
npx wrangler pages deploy ${{ github.workspace }}/blazorapp/wwwroot --project-name=${{ inputs.project-name }} --branch=${{ inputs.branch-name }}
shell: bash
env:
CLOUDFLARE_API_TOKEN: ${{ inputs.cloudflare-api-token }}
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.cloudflare-account-id }}
The site deploys fine, but the functions are MIA. When using the Github integration, it works fine.
No description
5 Replies
Smarter
SmarterOP3mo ago
I have since updated to use the offical and it does the same
Smarter
SmarterOP3mo ago
No description
Smarter
SmarterOP3mo ago
No description
Walshy
Walshy3mo ago
functions needs to be in the root of the command not the output dir
Smarter
SmarterOP3mo ago
Root of where I am executing wrangler from?
/usr/local/bin/npx wrangler pages deploy /home/runner/work/Folder1/Folder2/blazorapp/wwwroot --project-name=censored --branch=main
/usr/local/bin/npx wrangler pages deploy /home/runner/work/Folder1/Folder2/blazorapp/wwwroot --project-name=censored --branch=main
functions folder is inside wwwroot I believe I understand what you mean now. As in functions folder must exist WHERE I execute wrangler from. Regardless of what build directory I pass it. This indeed worked! Thank you very much!
Want results from more Discord servers?
Add your server