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

Setup preview deploys for pull requests #1357

Merged
merged 25 commits into from
Sep 8, 2022
Merged

Setup preview deploys for pull requests #1357

merged 25 commits into from
Sep 8, 2022

Conversation

jonrohan
Copy link
Member

@jonrohan jonrohan commented Sep 7, 2022

This setups up preview deploys for the current /demo/ app, which is only storybook.

The script runs by creating a new container instance on azure with the PR number in it. This was heavily inspired by the workflow in https://github.com/github/docs/blob/main/.github/workflows/azure-preview-env-deploy.yml

image

Follow up todo

I'd like to follow up this PR with the following


@peterbe @mikesurowiec Would you mind reviewing this PR to let me know if I need anything else?

@jonrohan jonrohan requested review from a team and keithamus September 7, 2022 19:06
@changeset-bot
Copy link

changeset-bot bot commented Sep 7, 2022

⚠️ No Changeset found

Latest commit: 0c41703

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jonrohan jonrohan temporarily deployed to github-pages September 7, 2022 20:02 Inactive
@jonrohan jonrohan temporarily deployed to review-pr-1357 September 7, 2022 20:45 Inactive
@jonrohan jonrohan temporarily deployed to github-pages September 7, 2022 20:49 Inactive
@jonrohan jonrohan temporarily deployed to review-pr-1357 September 7, 2022 21:00 Inactive
@jonrohan jonrohan temporarily deployed to review-pr-1357 September 7, 2022 23:30 Inactive
@jonrohan jonrohan temporarily deployed to github-pages September 7, 2022 23:34 Inactive
@jonrohan jonrohan temporarily deployed to review-pr-1357 September 7, 2022 23:48 Inactive
@jonrohan jonrohan temporarily deployed to github-pages September 7, 2022 23:51 Inactive
@mikesurowiec
Copy link

mikesurowiec commented Sep 7, 2022

Nice!

I'd also recommend adding a "destroy" workflow, similar to this: https://github.com/github/docs-internal/blob/main/.github/workflows/azure-preview-env-destroy.yml

It removes the docker images, the running container instance, and the github "deployment" (https://github.com/github/docs-internal/deployments) for that environment.

Heh, sorry! Looked at code first without reading your OP :)

@jonrohan jonrohan temporarily deployed to review-pr-1357 September 8, 2022 00:59 Inactive
@jonrohan jonrohan temporarily deployed to github-pages September 8, 2022 01:07 Inactive
name: Demo Preview

on:
pull_request:
Copy link

Choose a reason for hiding this comment

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

Shouldn't this be ?

Suggested change
pull_request:
pull_request_target:

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we want to restrict it running on forks, so keeping it as pull_request only is what I'd prefer for now, might change this in the future though

name: Demo Preview

on:
pull_request:
Copy link

Choose a reason for hiding this comment

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

ditto

@peterbe
Copy link

peterbe commented Sep 8, 2022

Is http://primer-view-components-preview-1357.eastus.azurecontainer.io/ and https://primer-020b8eb3dd-26611710.drafts.github.io/ as you'd expect it? If so, r=me

@jonrohan jonrohan merged commit 94959cb into main Sep 8, 2022
@jonrohan jonrohan deleted the review_lab_deploys branch September 8, 2022 16:05
jonrohan added a commit that referenced this pull request Sep 17, 2022
* Adding deploy preview script

* change url to app name base

* port 80

* setting key

* not https

* Not using this variable

* clear up variables

* set port?

* variable updates

* Fixing app_name

* setup key

* Wrong config

* try passing master key var

* setup params

* fix typo

* Don't run on changesets

* use branches-ignore

* setup paths to run on

* Adding destroy workflow

* Use docker image

* Use env.

* Renaming workflows to make more sense

* We don't have the container tagged
jonrohan added a commit that referenced this pull request Sep 17, 2022
…1319)

* Create 0252-build-component-css-with-ruby-code.md

* update per comments

* Adding release canary npm workflow (#1359)

* Adding canary preview

* Ignore changeset

* changeset ignore

* actions permissions

* update

* remove name

* ignore dependabot

* on push

* Setup preview deploys for pull requests (#1357)

* Adding deploy preview script

* change url to app name base

* port 80

* setting key

* not https

* Not using this variable

* clear up variables

* set port?

* variable updates

* Fixing app_name

* setup key

* Wrong config

* try passing master key var

* setup params

* fix typo

* Don't run on changesets

* use branches-ignore

* setup paths to run on

* Adding destroy workflow

* Use docker image

* Use env.

* Renaming workflows to make more sense

* We don't have the container tagged

* Ignore changeset

* make sure markdownlint sees the file

* Bump @primer/css from 20.4.4 to 20.4.5 in /docs (#1360)

Bumps [@primer/css](https://github.com/primer/css) from 20.4.4 to 20.4.5.
- [Release notes](https://github.com/primer/css/releases)
- [Changelog](https://github.com/primer/css/blob/main/CHANGELOG.md)
- [Commits](primer/css@v20.4.4...v20.4.5)

---
updated-dependencies:
- dependency-name: "@primer/css"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @primer/css from 20.4.4 to 20.4.5 in /demo (#1361)

Bumps [@primer/css](https://github.com/primer/css) from 20.4.4 to 20.4.5.
- [Release notes](https://github.com/primer/css/releases)
- [Changelog](https://github.com/primer/css/blob/main/CHANGELOG.md)
- [Commits](primer/css@v20.4.4...v20.4.5)

---
updated-dependencies:
- dependency-name: "@primer/css"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @primer/css from 20.4.4 to 20.4.5 (#1362)

Bumps [@primer/css](https://github.com/primer/css) from 20.4.4 to 20.4.5.
- [Release notes](https://github.com/primer/css/releases)
- [Changelog](https://github.com/primer/css/blob/main/CHANGELOG.md)
- [Commits](primer/css@v20.4.4...v20.4.5)

---
updated-dependencies:
- dependency-name: "@primer/css"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* demo preview small tweaks

* Add Primer::Alpha::ToggleSwitch to the docs build task (#1364)

* added toggleswitch to docs.rake, and rebuilt arguments.yml

* added changeset

* Remove pull step

* Remove label.md from git

* Bump @primer/gatsby-theme-doctocat from 4.0.0 to 4.1.0 in /docs (#1369)

Bumps @primer/gatsby-theme-doctocat from 4.0.0 to 4.1.0.

---
updated-dependencies:
- dependency-name: "@primer/gatsby-theme-doctocat"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Version Packages (#1356)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Delete the deprecated Primer::ButtonGroup component (#1372)

* Removing deprecated ButtonGroup

* docs: build docs

* Create eight-pants-yell.md

Co-authored-by: Actions Auto Build <actions@github.com>

* Delete the deprecated Primer::BaseButton component (#1371)

* Delete the deprecated Primer::BaseButton component

* Updating docs link

* Create friendly-rats-wait.md

* Convert the rest of the primer storybook stories to view component previews (#1365)

* Removing Deprecated Primer::Tooltip story

* converting SpinnerComponent story to preview

* Remove deprecated BlankslateComponent story

* Primer::Box doesn't have controls

* Primer::ButtonComponent is deprecated

* Converting ClipboardCopy to preview

* Removing value

* Removing deprecated dropdown stories

* Convert dropdown to preview

* Setup menu stories

* Delete FlexComponent deprecated stories

* Convert HellipButton

* Removing imagecrop stories

* Remove label component

* Delete animation stories

* Converting LayoutComponent stories

* Convert LinkComponent preview

* Converting OcticonComponent

* Converting ProgressBarComponent

* Removing TabContainer stories

* Convert SubheadComponent preview

* Remove deprecated Truncate

* Convert StateComponent preview

* Convert Markdown preview

* Convert TimelineItemComponent preview

* Converting MenuComponent

* Converting PopoverComponent preview

* Put back stories until we remove storybook server

* Demo lookbook (#1374)

* add lookbook to demo

* Updating assets and routes for docker

* Removing javascript_importmap_tags

* copy entire app folder

* try docker_image

* use tag argument

* don't use lookbook unless rails is more than 7

* push all tags

* if rails is greater than 7

* Setup IMAGE_TAG variable

* Missed a quote

* push all tags

* try tag param

* image.tags?

* check rails_version

* better if

* check version

* try manual push

* or main

* Does connecting in manifest fix path?

* only js right now

* connect to pvc css

* Try pulling cache to speed up?

* Fixing gem updates

* pull from image_url ignore if it doesn't exist

* switch to unless

* only if Lookbook is defined

* use application import

* if defined

* Remove lookbook params

* load form paths

* install postcss

* Copy postcss mixins

* nocov on routes config

* Copy forms to docker file also

* don't ignore forms

Co-authored-by: Joel Hawksley <joel@hawksley.org>

* Deleting the old lookbook folder (#1375)

* Deleting the old lookbook folder

* Add hotwire-livereload

* Remove from gemfile

* Fixing markdown headings

* Setting env to test for rake tasks

* Adding octicon option

* Specify tag to deploy

* just use latest

* Adding lookbook links to docs output (#1376)

* Adding lookbook links to docs output

* remove component suffix

* Making sure everything has a default

* remove hidden default

* Fixing remaining previews

* Also remove storybook_url

* exclude generated docs previews

* Fixing auto_complete test

* Separate run for slow tests (#1378)

* Separate run for slow tests

* same version

* run yarn

* combine fast tests

* Run axe scanner on written previews in test/previews (#1377)

* Running axe scan on written previews

* put raise back

* Can't run raise here

* Ignore standalone

* Run deprecated job as a test instead of ci job (#1379)

* Run deprecated job as a test

* Update component_test.rb

* Use system name

* Simplify CI configuration to a single build per Ruby/Rails version. (#1381)

* Simplify CI configuration to a single build per Ruby/Rails version.

Our existing CI configuration runs a multi-build matrix for the main test suite. I think this is overkill for our needs. In my experience, our matrix builds have mainly served us by testing each version of Rails and Ruby we support, not every combination of Ruby and Rails we support. I think we can get by with just 3 builds.

* use matrix for test and benchmark builds

* Create tricky-tomatoes-thank.md

* Docs change to fix typo and descriptions in dialog.rb (#1382)

* Update dialog.rb

Fixed a small typo and what may have been missed copy pasta for the position & position_narrow attributes

* Create neat-baboons-do.md

Co-authored-by: Jon Rohan <rohan@github.com>

* Accepted

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Joel Hawksley <joel@hawksley.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: River Lynn Bailey <river.bailey@testdouble.com>
Co-authored-by: GitHub Design Systems Bot <30705008+primer-css@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Actions Auto Build <actions@github.com>
Co-authored-by: Ru Levin <kangarruu@github.com>
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