nickytonline / astro-partykit-starter

https://astro-partykit-react-starter.netlify.app
8 stars 7 forks source link

chore: Add Partykit as part of the deployment. #10

Closed nickytonline closed 10 months ago

nickytonline commented 10 months ago
  1. Run npx partykit@latest token generate to generate a token.
  2. Run ntl env:set PARTYKIT_LOGIN nickytonline to add it to the environment variables for Netlify deploys.
  3. Run ntl env:set PARTYKIT_TOKEN THE_GENERATED_SUPER_SECRET_TOKEN to add it to the environment variables for Netlify deploys.
  4. Run ntl env:set PUBLIC_PARTYKIT_HOST https://astro-partykit-starter-party.nickytonline.partykit.dev so that the production URL for Partykit is available for the deployment.
  5. Need to run partykit deploy as part of the deployment.

https://github.com/nickytonline/astro-partykit-starter/blob/f8f7cbb7d9f52c0d861e0027ef67661bffb1a6a7/package.json#L8

-  "build": "astro check && astro build",
+  "build": "astro check && astro build && partykit deploy",
  1. Update the code for getting the Partykit URL to the following in https://github.com/nickytonline/astro-partykit-starter/blob/f8f7cbb7d9f52c0d861e0027ef67661bffb1a6a7/src/components/Party.tsx#L5
- const host = import.meta.env.PUBLIC_PARTYKIT_HOST ?? "localhost:1999";
+ const isProd = import.meta.env.PROD;
+ const host = isProd ? import.meta.env.PUBLIC_PARTYKIT_HOST : "localhost:1999";
github-actions[bot] commented 10 months ago

Thanks for the issue, our team will look into it as soon as possible! If you would like to work on this issue, please wait for us to decide if it's ready. The issue will be ready to work on once we remove the "needs triage" label.

To claim an issue that does not have the "needs triage" label, please leave a comment that says ".take".

For full info on how to contribute, please check out our contributors guide.

nickytonline commented 10 months ago

I've already done steps 1-4 as they are environment variables for continuous integration/continuous deployment (CI/CD) on Netlify that don't involve code changes.

I'll get to steps 5 and 6 in the next few days (post snowboarding) unless @adiati98, you'd like to make those changes. If so, feel free to assign yourself and unassign me.

adiati98 commented 10 months ago

Taking it over, @nickytonline. 👍

Adding myself as an assignee and leave yours as is.😉