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

Deploy with GH Pages #820

Closed
wants to merge 31 commits into from
Closed

Deploy with GH Pages #820

wants to merge 31 commits into from

Conversation

emplums
Copy link

@emplums emplums commented May 29, 2020

Description

This PR moves our preview deploys from Now/vercel to GH Pages via an amazing action that I copypasta'd from @lerebear 's work! 🙌 🎉 Huge shoutout to Lere for coming up with these workflows!

I've also built an action for deploying our docs to the production url (https://primer.github.com/components). I tested it by changing the action to run on pushes to this branch and it worked smoothly and deployed here: https://primer.github.io/components (note that contributor data doesn't show up, but i fixed that in a later commit)

Notes

I needed to use a personal access token in the request_deployment workflows because jobs using the GITHUB_TOKEN are prevented from triggering other workflows as Lere pointed out in his original PR

Rollout Plan

  • Merge this PR and make sure deploys on pushes to master works
  • Test that a path alias in primer.style pointing to a non-vercel deploy works okay. I don't see anything in the vercel docs that says otherwise so I think it should be fine, but to test carefully we could set up a route like this:
    {"src": "/test-components(/.*)?", "dest": "https://primer.github.com/components"},
  • Remove the vercel integration on this repository
  • Migrate over other repositories. See migration for other repos below

To do:

  • URLs off the root are not resolving correctly
  • Animation in hero is not displaying
  • Add seperate job for deploying to production
  • Contributions isn't working - I noticed in the deploy to production action that the script output this error Non-deploy build and no GITHUB_TOKEN environment variable set; skipping GitHub API calls. the GITHUB_TOKEN environment variable should be set so I need to see if there's some way that this script classifies something as a deploy/non-deploy build fixed this just for production builds so we don't have to wait for all the API calls for each deploy preview. need to double check that it worked after merging to master

Migration Plan for Other Repos

  • Add a personal staging deployment token to repo
  • Copy over workflow files
  • Update name, repo, environment_url in deploy-to-gh-pages.yml
  • Update name, environment_url, and repo in deploy-to-staging.yml
  • Update repo and description in request-staging-deployment.yml
  • Update pathPrefix in gatsby-config.yml

Possible Improvements

  • Might be able to clean up the code a bit and have one file for requesting deploys & one file for doing deployments and separate steps with if parameters for each environment?

@vercel
Copy link

vercel bot commented May 29, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-components/akz4lzv8s
✅ Preview: https://primer-components-git-preview-deploys.primer.vercel.app

@vercel vercel bot temporarily deployed to Preview May 29, 2020 00:32 Inactive
@vercel vercel bot temporarily deployed to Preview May 29, 2020 00:44 Inactive
@emplums emplums requested a review from BinaryMuse May 29, 2020 00:47
@@ -24,5 +24,5 @@ module.exports = {
}
}
],
pathPrefix: '/components'
pathPrefix: `/components${process.env.STAGING_PATH_PREFIX || ''}`
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it so that urls work with the weird staging deploy URLs

@vercel vercel bot temporarily deployed to Preview May 29, 2020 00:52 Inactive
@vercel vercel bot temporarily deployed to Preview May 29, 2020 01:03 Inactive
@vercel vercel bot temporarily deployed to Preview May 29, 2020 01:05 Inactive
@vercel vercel bot temporarily deployed to Preview May 29, 2020 01:18 Inactive
@vercel vercel bot temporarily deployed to Preview May 29, 2020 01:23 Inactive
@vercel vercel bot temporarily deployed to Preview May 29, 2020 01:37 Inactive
@vercel vercel bot temporarily deployed to Preview May 29, 2020 01:43 Inactive
@vercel vercel bot temporarily deployed to Preview June 15, 2020 23:06 Inactive
@vercel vercel bot temporarily deployed to Preview June 15, 2020 23:20 Inactive
@vercel vercel bot temporarily deployed to Preview June 15, 2020 23:30 Inactive
@vercel vercel bot temporarily deployed to Preview June 15, 2020 23:59 Inactive
@emplums emplums temporarily deployed to production June 15, 2020 23:59 Inactive
@vercel vercel bot temporarily deployed to Preview June 16, 2020 00:06 Inactive
@emplums emplums temporarily deployed to production June 16, 2020 00:06 Inactive
@emplums emplums had a problem deploying to staging June 16, 2020 00:06 Failure
@vercel vercel bot temporarily deployed to Preview June 16, 2020 00:15 Inactive
@emplums emplums temporarily deployed to production June 16, 2020 00:16 Inactive
@vercel vercel bot temporarily deployed to Preview June 16, 2020 00:22 Inactive
@emplums emplums temporarily deployed to Production June 16, 2020 00:23 Inactive
@emplums
Copy link
Author

emplums commented Jun 24, 2020

Closing this for now - I've written up some thoughts on why this doesn't feel like the best approach right now here: https://docs.google.com/document/d/1FImxLWEwKslz_Tu6s-3QXifSHqaX4_2UP2q9Gixb6gE/edit?usp=sharing

Unfortunately I needed to discuss some confidential stuff in the doc so the sharing is set to only GH employees, if anyone has any questions though feel free to ask here and I will try to answer! 😄

@emplums emplums closed this Jun 24, 2020
@colebemis colebemis deleted the preview-deploys branch October 29, 2021 00:44
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

Successfully merging this pull request may close these issues.

3 participants