Programmatically toggle Oxygen preview urls as Public / Private #1249
cmhnk
started this conversation in
Ideas + Feature Requests
Replies: 1 comment 3 replies
-
@graygilmore Do you know if there's any way to access preview sites from CI? 🤔 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using the LighthouseCI Github Action to monitor performance of my Hydrogen site.
Currently the way I'm able to do this is by having two separate jobs within the
.github/workflows/oxygen-deployment.yml
file. After thedeploy
job succeeds, I have alighthouse
job that runs Lighthouse on the preview URL from thedeploy
step.Because preview URLs are private by default, the first time the
lighthouse
job runs, it always fails. As a temporary workaround, I thought I could go into Shopify > Channels > Hydrogen and set the preview URL to public, re-run the failed Lighthouse job, then set the preview URL back to private. However, Hydrogen seems to think the Preview Deployment failed and thus I can't set the preview URL to public -- even though thedeploy
job succeeds and there is indeed a preview URL.Unable to toggle deployment to public:
![image](https://private-user-images.githubusercontent.com/16675152/261720544-ecce7487-965f-47f2-83c0-7158ab14beb3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzM2NzAsIm5iZiI6MTczOTE3MzM3MCwicGF0aCI6Ii8xNjY3NTE1Mi8yNjE3MjA1NDQtZWNjZTc0ODctOTY1Zi00N2YyLTgzYzAtNzE1OGFiMTRiZWIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA3NDI1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc1YTgzZmRlMzhmNzRjMWJjMTlhNjIzYjZlMWQxZmM4OGE0NzZkZDUwMDY0YWMxMzI3OTdhYTA2ODE4YjJiM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.zTVu-TGGVbhRlWMOUPTRF4u-hWQf3IGoaTIWRoAMGxE)
But there is a deployment:
![image](https://private-user-images.githubusercontent.com/16675152/261720674-fe329274-0d38-4db0-ade0-686d909bd013.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzM2NzAsIm5iZiI6MTczOTE3MzM3MCwicGF0aCI6Ii8xNjY3NTE1Mi8yNjE3MjA2NzQtZmUzMjkyNzQtMGQzOC00ZGIwLWFkZTAtNjg2ZDkwOWJkMDEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA3NDI1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVkOTFhNjE5NTE0NmE0YmJlY2Y1OTBjOTVhYjg5MWE2YThlZjg5YzBhNzVhMjY0ZDMxYjEzNWU0MGMzM2UzOTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.O8K0qPulkffr020iuhKH3m5BEjO8UG_Bd_VNk3auLk4)
The ability to either (a) programmatically login to a preview site (I didn't have luck with browser automation tools like puppeteer because of captchas) or (b) toggle preview URLs privacy settings (ex. via GraphQL API or the shopify-cli) would be very helpful.
If there's a better approach for accessing preview sites in CI/CD, please let me know. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions