Comments (10)
We just reverted the commit for this, and will release v1.4.1 now.
from pages-action.
I'm using Cloudflare Pages to deploy a version of a web app on every PR, where we pass a custom branch
to match the project + PR's number. Here's the workflow using cloudflare/pages-action
:
on:
pull_request:
# ...
jobs:
# ...
- id: deploy
name: Deploy `client` to preview environment
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.PROJECT_NAME }}
directory: ./apps/client/build
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: "client-pr${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ github.token }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
And the error would be:
/home/runner/work/_actions/cloudflare/pages-action/v1/index.js:5857
const error = new requestError.RequestError(toErrorMessage(data), status, {
^
RequestError [HttpError]: No ref found for: client-pr123
from pages-action.
Thank you both!
@WalshyDev, here's my assessment of what went wrong with #56 for these users:
- They have set
gitHubToken
to enable GitHub deployments and deployment statuses - They have set
branch
to a "virtual" branch name that does not match a real branch in the repository (!) - #56 expected
branch
to be the name of a real branch, and failed if it was not
I did not expect this, sorry! I had no idea people were using fake branch names when deploying to Cloudflare Pages. I can file an updated PR that ignores the branch
input and just uses the real branch name for GitHub deployments.
from pages-action.
@aaronadamsCA, same as @ivolimasilva. I have one more conditional deploy to test.*.pages.dev
. Mine below.
---
name: Deploy mkdocs
on:
pull_request:
branches:
- main
env: [...]
jobs:
deployment:
runs-on: ubuntu-latest
environment:
name: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- run: pip install --upgrade pip
- run: pip install -r .python/requirements.txt
- run: mkdocs build --strict
- name: Publish to Cloudflare Pages
uses: cloudflare/[email protected]
with:
accountId: ${{ env.CF_ACCOUNT_ID }}
projectName: ${{ env.CF_PROJECT_NAME }}
apiToken: ${{ secrets.CF_API_TOKEN }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: 'test'
directory: site/
from pages-action.
We use virtual branch
names too in our org. This is useful to model persistent environments that are all deployed from the main branch without having to actually maintain separate git branches. Nice to see this reverted in 1.4.1
. I definitely see how this change in behavior could happen as branch alias
is assumed in the Cloudflare docs to be an actual branch.
from pages-action.
Updating to cloudflare/pages-action@v1
worked for me.
from pages-action.
@aantipov Could you please share the action inputs you were passing to the action when you encountered this error?
I'm trying to figure out how to reproduce this. I contributed #56 specifically so pull_request
events would get the correct ref, and it works for me, but obviously failed for a bunch of other people, so I'd like to figure out why.
from pages-action.
CC @jkorichneva, @felixlublasser, @ivolimasilva, @limakzi, @tamacti - same as above, if you could please share your GitHub Actions workflow where you encountered this issue, I'm trying to reproduce your error so I can fix the original PR.
from pages-action.
@aaronadamsCA I can explain it.
Fake branch name maps to a subdomain.
Having secrets specific to the environment happens to be useful. ;)
from pages-action.
@snorremd I haven't seen such assumption, that branch
MUST, by the RFC, match real branch-name; correct me if I am wrong. I would prefer to call it - environmentName
.
This variable name would fit real behavior better.
from pages-action.
Related Issues (20)
- how can I set a service binding via this action? HOT 1
- Post-upload fails HOT 3
- Unable to publish site, API return 503 and 504 errors HOT 1
- Disable Wrangler
- Specifying `--compatibility-flags` HOT 2
- Action fails after Deployment complete! HOT 2
- GitHub Actions failing on run
- Deploying with cloudflare/pages-action but cannot locate sveltekit build directory HOT 2
- Update README GITHUB_TOKEN to DEPLOY_TOKEN HOT 1
- Authentication Error 10000 on endpoint /upload-token HOT 1
- Trunk based development and differentiating preview vs production env
- Project not found. The specified project name does not match any of your existing projects. HOT 1
- Transitioning from Node 16 to Node 20 HOT 27
- Impossible to set branch deployment options with this action? HOT 1
- Incorrect alias HOT 3
- "No deployment available" when deploying with this action HOT 1
- Failed runs-on windows-latest with node 18/20. But node 16 works fine.
- Using CF_PAGES_URL HOT 2
- Is this repository deprecated, unmaintained ? HOT 5
- How can I automatically post the preview address as a comment? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pages-action.