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.
I am getting error like below when github action starts running.
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:21Error: 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