cloudflare / pages-action

MIT License
440 stars 91 forks source link

Transitioning from Node 16 to Node 20 #117

Open fatihsever opened 5 months ago

fatihsever commented 5 months ago

Node.js 16 actions are deprecated. Please update the action to use Node.js 20.

https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

The transition seems easy. For example, the official cache action completed the transition with a few file updates: https://github.com/actions/cache/pull/1284/files

Thanks.

AVGVSTVS96 commented 5 months ago

@cloudflare Is this getting updated? I'm surprised to see no updates on this official Cloudflare action.

jonathanspw commented 4 months ago

Bump

jeroensmink98 commented 4 months ago

I'm getting the same, wondering when Cloudflare will update this action?

sebdanielsson commented 4 months ago

Have someone tried reaching out on their Discord?

IanVS commented 4 months ago

There's an unmerged PR that would fix this, it looks like https://github.com/cloudflare/pages-action/pull/118.

Maybe it's time to look for an unofficial pages action, or fork this one, since it seems to be unmaintained.

JesusValera commented 4 months ago

Bump

cristianmadularu commented 4 months ago

Any updates?

emad0082 commented 3 months ago

Bump

cristianmadularu commented 3 months ago

I raised on their Discord as well where they indicated that they were aware of it but there is no indication regarding the time frame when it would be adressed.

codyro commented 3 months ago

Bump

gkorakas-eli commented 3 months ago

Any updates on this?

naiyerasif commented 3 months ago

Just an FYI for people still waiting for updates on this action, you can directly use cloudflare/wrangler-action@v3 (which uses Node.js 20) to deploy a site on Cloudflare Pages.

For example, say, you had the following step configuration using cloudflare/pages-action@v1:

- name: Publish to Cloudflare Pages
  uses: cloudflare/pages-action@v1
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
    directory: dist

You can swap the above configuration with the following step configuration:

- name: Deploy to Cloudflare Pages
  uses: cloudflare/wrangler-action@v3
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --commit-dirty=true
cristianmadularu commented 3 months ago

Ah great, thank you!

fatihsever commented 3 months ago

Just an FYI for people still waiting for updates on this action, you can directly use cloudflare/wrangler-action@v3 (which uses Node.js 20) to deploy a site on Cloudflare Pages.

This is great news! I will switch to it asap. Thanks @naiyerasif.

wmitsuda commented 3 months ago

Is wrangler-action going to succeed pages-action (which seems completely abandoned)?

if so, it would be nice if someone from CF at least could make a public statement and update the docs (which direct users to use pages-action for direct uploads).

cristianmadularu commented 3 months ago

@wmitsuda I do not know and CF does not seem to reply, but, I have tried the wrangler action as indicated by @naiyerasif and it works great.

wmitsuda commented 3 months ago

I just migrated it and it is working for me as well. It is a shame CF does not care for proper communication.

vorant94 commented 2 months ago

pages-action has gitHubToken param to enable GitHub Deployments.

Does anyone from those who migrated to wrangler-action know if it also has support for it?

I don't see gitHubToken on wrangler-action README as of now...

cristianmadularu commented 2 months ago

pages-action has gitHubToken param to enable GitHub Deployments.

Does anyone from those who migrated to wrangler-action know if it also has support for it?

I don't see gitHubToken on wrangler-action README as of now...

I did not have to change anyting other than the action to be used and it worked for me.

davidhouweling commented 2 months ago

the difference between wrangler-action and pages-action is that wrangler-action is used to deploy to cloudflare specifically (which this uses). This action extends that capability with the ability to post message to github + deployment status. that's what the github token is used for.

naiyerasif commented 2 months ago

the difference between wrangler-action and pages-action is that wrangler-action is used to deploy to cloudflare specifically (which this uses). This action extends that capability with the ability to post message to github + deployment status. that's what the github token is used for.

You can publish the deployment status with a job summary while using wrangler-action. You don't necessarily need a token to do this (until and unless you're doing something with GitHub's API).

You can find additional examples and documentation on Job Summaries at the following links.

davidhouweling commented 2 months ago

Thanks @naiyerasif for the info and I was definitely wanting something like that. I think my point still stands though if you're purely looking at it as a 1:1 comparison between this and wranger. My comment was based on looking at the code directly.

https://github.com/cloudflare/pages-action/blob/aeb0d936a7e08b4861c3d0ac8811fe39138085f9/src/index.ts#L146-L149

IanVS commented 1 week ago

It sounds like there are indeed plans to deprecate this action and move folks to action-wrangler: https://github.com/cloudflare/pages-action/issues/131#issuecomment-2203648174

sebdanielsson commented 1 week ago

Just an FYI for people still waiting for updates on this action, you can directly use cloudflare/wrangler-action@v3 (which uses Node.js 20) to deploy a site on Cloudflare Pages.

For example, say, you had the following step configuration using cloudflare/pages-action@v1:

- name: Publish to Cloudflare Pages
  uses: cloudflare/pages-action@v1
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
    directory: dist

You can swap the above configuration with the following step configuration:

- name: Deploy to Cloudflare Pages
  uses: cloudflare/wrangler-action@v3
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --commit-dirty=true

Will this step still deploy PRs to the preview environment and pushes to main to the production environment?

naiyerasif commented 1 week ago

Just an FYI for people still waiting for updates on this action, you can directly use cloudflare/wrangler-action@v3 (which uses Node.js 20) to deploy a site on Cloudflare Pages. For example, say, you had the following step configuration using cloudflare/pages-action@v1:

- name: Publish to Cloudflare Pages
  uses: cloudflare/pages-action@v1
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
    directory: dist

You can swap the above configuration with the following step configuration:

- name: Deploy to Cloudflare Pages
  uses: cloudflare/wrangler-action@v3
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --commit-dirty=true

Will this step still deploy PRs to the preview environment and pushes to main to the production environment?

That depends on your branch deployment controls rather than wrangler command.

sebdanielsson commented 1 week ago

Just an FYI for people still waiting for updates on this action, you can directly use cloudflare/wrangler-action@v3 (which uses Node.js 20) to deploy a site on Cloudflare Pages. For example, say, you had the following step configuration using cloudflare/pages-action@v1:

- name: Publish to Cloudflare Pages
  uses: cloudflare/pages-action@v1
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
    directory: dist

You can swap the above configuration with the following step configuration:

- name: Deploy to Cloudflare Pages
  uses: cloudflare/wrangler-action@v3
  with:
    apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
    accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
    command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --commit-dirty=true

Will this step still deploy PRs to the preview environment and pushes to main to the production environment?

That depends on your branch deployment controls rather than wrangler command.

Sorry, I was a bit unclear with my comment. I meant if it would still update the GitHub deployment status, but as far as I can tell, it doesn't. I've created a feature request for this in the wrangler-action repository...