Open natemoo-re opened 9 months ago
If this is working maybe you look into merging?
@KorigamiK If you want to try this PR while we're working on it, you're welcome to point your repository to it! Using withastro/action@configure-site
should do the trick.
Looking forward to test this @natemoo-re ๐ฏ what did I miss here? https://github.com/ollegkz/olle.coffee/actions/runs/7401803673/job/20138353320
Looking forward to test this @natemoo-re ๐ฏ what did I miss here? https://github.com/ollegkz/olle.coffee/actions/runs/7401803673/job/20138353320
That is probably on my end! I'm guessing the command is not correct so Bun is printing its help message instead
Seems to work as of https://github.com/withastro/action/commit/6e05a33aadf24152da04c9a037e5a23a53fb2852 as you can see https://github.com/ollegkz/olle.coffee/actions/runs/7423744689/job/20201840905 but the url is no longer printed out in the deploy complete step ๐ฎ
Compare https://github.com/ollegkz/olle.coffee/actions/runs/7423744689/job/20201840905 complete job with https://github.com/ollegkz/olle.coffee/actions/runs/7400679346/job/20134828466 :suprised_pikachu:
Thanks @ollegkz! I forked your repo so I can test changes directly against it. I think it's bun-specific.
Any luck on merging this @natemoo-re? ๐ฅ
Works for root deployment. And base works too. ๐
To summarize then, the "site" param in astro.config.js
is no longer mandatory for deployment?
But base still has a few gotchas, if deploying with a base:
astro dev
sites with internal links, you still have to define a base in your configBut I hope we can simplify the docs a bit once this is merged.
Hmm, I just noticed that actions/configure-pages@v3 uses node16 and actions/configure-pages@v4 uses node20 :)
I'm converting this to a draft since I haven't had time to finish this up! I still think this is a better solution that what we have currently, but I'm hesitant about spawning the astro
CLI directly.
If anyone else wants to pick this up, please do. Otherwise I will try to circle back to this in the future.
After looking at how we recommend this action is used, it turns out we can do a bit more to make it simple for people to use. This would be a great v2 for this action.
Based on https://github.com/actions/configure-pages, we can automatically infer the correct
--site
and--base
flags for Astro to use when building. This eliminates the main gotcha with our current setup (that you almost certainly need to update your config with these values).This also automatically uses
actions/checkout@v4
to pull your repo andactions/deploy-pages@v2
to deploy your site to GitHub Pages. These changes mean that our recommended setup is greatly simplified.Instead of running
npm run build
, we now run theastro
CLI directly. Honestly this is the change I'm most hesitant about, because some folks might want CI to fail ifastro-check
fails or use pre/post-build scripts. This change would skip those and just doastro build
. Open to feedback!