Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pages deploy does not deploy to production #337

Open
dapperdandev opened this issue Dec 10, 2024 · 2 comments
Open

pages deploy does not deploy to production #337

dapperdandev opened this issue Dec 10, 2024 · 2 comments

Comments

@dapperdandev
Copy link

I'm trying to deploy to production (not preview). There doesn't seem to be an option to do so.

            - name: Deploy
              uses: cloudflare/wrangler-action@v3
              with:
                  apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
                  accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
                  command: pages deploy dist --project-name=app-${{env.ENV_NAME}}

image

@dapperdandev
Copy link
Author

Found my own solution. HEAD in the screenshot in the original report is the GitHub branch. In this case, it's HEAD because the action was triggered on release creation.

I found the option to change the "production branch" and updated that to rc, since we'll be triggering this action on pull_request to rc.

image
image

I still have a question:

I can pass the --branch=my-branch-name in the command. This doesn't actually change where the code I upload comes from though. It seems to just be a roundabout way of telling CloudFlare Pages to deploy to production or preview. Is that right? Or does CloudFlare have a concept of branches on their end? If so, how do we manage branches in CloudFlare Pages?

@BeyondEvil
Copy link

I still have a question:

I can pass the --branch=my-branch-name in the command. This doesn't actually change where the code I upload comes from though. It seems to just be a roundabout way of telling CloudFlare Pages to deploy to production or preview. Is that right? Or does CloudFlare have a concept of branches on their end? If so, how do we manage branches in CloudFlare Pages?

Yepp, that's right, it's a horribly named option as it's just a named reference to the deployment configured in Cloudflare (as "Source").

But there's no correlation to the branch, as wrangler will upload whatever asset(s) are on the commit that was checked out.

Furthermore, it amazes me to no end that Cloudflare lacks support for tags and multiple environments (dev, stage, production etc.) and that they claim that "most" use a Git Flow branch strategy. Which I'm pretty sure is a lie.

Anyway, enough ranting. Using the "--branch" option, once we understood it has nothing to do with branches, helped us solve so that we can publish previews for PRs, dev (main branch), and stage (release branches).

The only thing missing now is having static domains for dev and stage. The jury is out on if that's supported or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants