Deploying to GitHub Pages is problematic/flakey
📚 Subject area/topic
Deployment
📋 Page(s) affected (or suggested, for new content)
https://docs.astro.build/en/guides/deploy/github/
📋 Description of content that is out-of-date or incorrect
The problem probably lies with the recommended action withastro/action@v2. Still, I am reporting it here as I am uncertain of the maintenance/issue response time in withastro/action.
The action appears to be "flakey". At least, I've found it so over the past couple of weeks, and various attempts at "adjusting" it according to the instructions have had mixed results. This is true on multiple sites that are running Astro and hosted on GitHub pages.
I'm concerned whether the action's internal dependencies are out of date; I think it's an effect of other "down-chain" dependencies in that action, so it maybe just needs more version bumps. I do notice a number of unaddressed PRs in that repo.
In any case, I keep getting:
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: pnpm/action-setup@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Of course, the pnpm/action-setup@v2 isn't in the YAML offered in your docs, but it seems to be getting triggered in the bowels of withastro/action@v2
Here is a sample of the output from the action running on my own blog. If you check my action history, it was working fine for a while but then started getting problems even though my deploy hadn't changed. I attempted "fixes", but once I thought it was stable, it broke on the next post.
Run withastro/action@v2
Run len=`echo $INPUT_PM | wc -c`
Run pnpm/action-setup@v2
Running self-installer...
Installation Completed!
Run actions/setup-node@v4
Found in cache @ /opt/hostedtoolcache/node/20.12.2/x[6](https://github.com/dgilleland/dgilleland.github.io/actions/runs/9035996590/job/24831915231#step:3:7)4
Environment details
/home/runner/setup-pnpm/node_modules/.bin/pnpm store path --silent
/home/runner/setup-pnpm/node_modules/.bin/store/v3
pnpm cache is not found
Run $PACKAGE_MANAGER install
ERR_PNPM_BAD_PM_VERSION This project is configured to use v9.0.6 of pnpm. Your current pnpm is v9.1.0
If you want to bypass this version check, you can set the "package-manager-strict" configuration to "false" or set the "COREPACK_ENABLE_STRICT" environment variable to "0"
Error: Process completed with exit code 1.
🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
Not reproducible in StackBlitz because it is a deployment issue for the GitHub and GitHub Actions environment.
And, of course, I may as well emphasize that this is a problem in my personal repo sites as well. My "hack" is to do a manual deploy to a non-default branch on GitHub and bypass Actions altogether. I hope this gets somebody's eyes on it at some point...
Thanks for reporting this! I am going to transfer this issue to the actions repo itself, as it's something that should be addressed there, and then they can advise whether our documentation needs to change, or whether it's a bug for them to fix!
Wondering if this can be closed, now that the docs already mention the correct version for the GitHub action?
Probably? :smile:
I'll close it, and someone is welcome to open another issue if they experience problems!