MD AMIR SOHAIL
MD AMIR SOHAIL
CDCloudflare Developers
Created by MD AMIR SOHAIL on 6/10/2024 in #pages-help
how to configure branches to deploy in production not in preview mode ?
I am using git flow and using workflow to deploy. When i am deploying from main branch it is going to production environment, if deployed from any other branch it shows preview. I need to deploy in production environment from main and as well as branch with prefix release (release/*). I am not able to do that. below is my workflow file. Basically my production deployment branch is main and i need to replace main with wildcard branch called release/**
2 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 3/14/2024 in #workers-help
Not able to Integrate sentry with my worker
No description
4 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 1/21/2024 in #pages-help
I am suddenly facing issue with worker deployment today previously it was working fine.
Below is the deployment issue which i am getting.
Run cloudflare/pages-action@1
with:
apiToken: ***
accountId: ***
projectName: client-staging
directory: ./apps/client-app/dist
gitHubToken: ***
wranglerVersion: 3
▲ [WARNING] `wrangler pages publish` is deprecated and will be removed in the next major version.

Please use `wrangler pages deploy` instead, which accepts exactly the same arguments.


Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)


✘ [ERROR] A request to the Cloudflare API (/accounts/***/pages/projects/client-staging/deployments) failed.

An unknown error occured. Contact your account team or Cloudflare support: https://cfl.re/3WgEyrH. [code: 8000000]

If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose


npm notice
npm notice New major version of npm available! 9.5.1 -> 10.3.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.3.0>
npm notice Run `npm install -g npm@10.3.0` to update!
npm notice
EXIT WHEN NOT EXPECTED

SHELLAC COMMAND FAILED!
Executing: npx wrangler@3 pages publish "./apps/client-app/dist" --project-name="client-staging" --branch="" in /home/runner/work/collab/collab

STDOUT:

Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)
Run cloudflare/pages-action@1
with:
apiToken: ***
accountId: ***
projectName: client-staging
directory: ./apps/client-app/dist
gitHubToken: ***
wranglerVersion: 3
▲ [WARNING] `wrangler pages publish` is deprecated and will be removed in the next major version.

Please use `wrangler pages deploy` instead, which accepts exactly the same arguments.


Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)


✘ [ERROR] A request to the Cloudflare API (/accounts/***/pages/projects/client-staging/deployments) failed.

An unknown error occured. Contact your account team or Cloudflare support: https://cfl.re/3WgEyrH. [code: 8000000]

If you think this is a bug, please open an issue at: https://github.com/cloudflare/workers-sdk/issues/new/choose


npm notice
npm notice New major version of npm available! 9.5.1 -> 10.3.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.3.0>
npm notice Run `npm install -g npm@10.3.0` to update!
npm notice
EXIT WHEN NOT EXPECTED

SHELLAC COMMAND FAILED!
Executing: npx wrangler@3 pages publish "./apps/client-app/dist" --project-name="client-staging" --branch="" in /home/runner/work/collab/collab

STDOUT:

Uploading... (5/5)
✨ Success! Uploaded 0 files (5 already uploaded) (0.24 sec)
3 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 11/24/2023 in #workers-help
Issue with Cors Header Blocking : Cloudflare Worker.
No description
3 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 10/31/2023 in #pages-help
anyone can help me with cloudflare pages i am trying to add CNAME but getting error inactive(error)
No description
22 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 7/27/2023 in #pages-help
Deploy on cloudflere Pages with github actions fails.
I am trying to auto deploy my project to cloudflare pages when there push in the staging branch or in production branch. below is my yml file for staging.
name: Publish Staging

on:
push:
branches:
- staging
pull_request:
types:
- synchronize

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
deployments: write

strategy:
matrix:
include:
- projectName: "portal-staging"

steps:
- name: Checkout 🛎
uses: actions/checkout@v3

- name: Setup node env 🏗
uses: actions/setup-node@v3
with:
node-version: 18.16.1
cache: "yarn"

- name: Install dependencies 👨🏻‍💻
run: yarn

- name: Run build
run: yarn portal:build

- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_STAGING_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_STAGING_ACCOUNT_ID }}
projectName: ${{ matrix.projectName }}
directory: ./apps/portal/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
name: Publish Staging

on:
push:
branches:
- staging
pull_request:
types:
- synchronize

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
deployments: write

strategy:
matrix:
include:
- projectName: "portal-staging"

steps:
- name: Checkout 🛎
uses: actions/checkout@v3

- name: Setup node env 🏗
uses: actions/setup-node@v3
with:
node-version: 18.16.1
cache: "yarn"

- name: Install dependencies 👨🏻‍💻
run: yarn

- name: Run build
run: yarn portal:build

- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_STAGING_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_STAGING_ACCOUNT_ID }}
projectName: ${{ matrix.projectName }}
directory: ./apps/portal/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
I am getting error like below when github action starts running.
Error: Failed to get Pages project, API returned non-200
at getProject (/home/runner/work/_actions/cloudflare/pages-action/1/index.js:22082:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /home/runner/work/_actions/cloudflare/pages-action/1/index.js:22167:21
Error: Failed to get Pages project, API returned non-200
at getProject (/home/runner/work/_actions/cloudflare/pages-action/1/index.js:22082:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /home/runner/work/_actions/cloudflare/pages-action/1/index.js:22167:21
2 replies