Skip to content

Add plumbing to upload schemas to GitHub Pages every day - #4727

Merged
hyperupcall merged 2 commits into
SchemaStore:masterfrom
hyperupcall:hyperupcall-buildwebsite
May 31, 2025
Merged

hyperupcall merged 2 commits into
SchemaStore:masterfrom
hyperupcall:hyperupcall-buildwebsite

Conversation

@hyperupcall

@hyperupcall hyperupcall commented May 23, 2025 •

Copy link
Copy Markdown
Member

This addresses the second part of #4695 (proposal 3)

@github-actions github-actions Bot added CI ".github/**/*" folder is updated (auto-generated by labeler action) config:gitignore cli.js Changes to the build system / JavaScript. labels May 23, 2025
@hyperupcall
hyperupcall marked this pull request as ready for review May 30, 2025 04:43
@hyperupcall

Copy link
Copy Markdown
Member Author

cc @madskristensen

@madskristensen

Copy link
Copy Markdown
Contributor

This is great

@hyperupcall

Copy link
Copy Markdown
Member Author

Great, merging

@hyperupcall
hyperupcall merged commit 4ea362b into SchemaStore:master May 31, 2025
@hyperupcall

hyperupcall commented May 31, 2025 •

Copy link
Copy Markdown
Member Author

@madskristensen The action fails:

Error: Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the `enablement` parameter for this action. Error: Not Found - https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site
Error: HttpError: Not Found - https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site

Adding GitHub action as a deployment source should fix it,.

@madskristensen

Copy link
Copy Markdown
Contributor

@hyperupcall Done!

@hyperupcall

hyperupcall commented Jun 2, 2025 •

Copy link
Copy Markdown
Member Author

@madskristensen Awesome! It works.

Is there anything else that I can do to prep for closing #4695? Or is it just a matter of updating DNS records?

@madskristensen

Copy link
Copy Markdown
Contributor

@hyperupcall is there a URL for the GH Pages site? I'll see if I can redirect the DNS, but I think we need to update the schema URLs in the catalog to point to the GH location instead of schemastore.org. If not, we lose the HTTP redirection. We can then move them to a schemastore.org URL once the DNS has been updated. Thoughts?

@hyperupcall

hyperupcall commented Jun 4, 2025 •

Copy link
Copy Markdown
Member Author

@madskristensen Yup, the GitHub pages schemas can be accessed like https://schemastore.github.io/schemastore/ava.json. I also created an index.html, so there is a homepage, but um I think that was a mistake and I'll replace that with a HTTP redirect to https://www.schemastore.org/json/.

I'll see if I can redirect the DNS, but I think we need to update the schema URLs in the catalog to point to the GH location instead of schemastore.org. If not, we lose the HTTP redirection. We can then move them to a schemastore.org URL once the DNS has been updated. Thoughts?

That sounds great. I created #4759 that does just that,.

@madskristensen

Copy link
Copy Markdown
Contributor

@hyperupcall there are still a bunch of references to json.schemastore.org in catalog.json. They will break due to the lack of subdomain redirection. If we move those to raw.githubusercontent.com, then it won't break during the transition.

@madskristensen

Copy link
Copy Markdown
Contributor

When we map the subdomain json.schemastore.org then we need a redirection rule somewhere such that https://json.schemastore.org/appveyor will resolve to the right path for https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/appveyor.json. Do you know how to create that redirection rule @hyperupcall?

@madskristensen

madskristensen commented Jun 4, 2025 •

Copy link
Copy Markdown
Contributor

DNS is now moved for schemastore.org and www.schemastore.org. There is no styling on the site, since only the index.html file is written. Could we create the website folder with all the assets (png, js, css) and then copy that entire folder in cli.js?

@hyperupcall

Copy link
Copy Markdown
Member Author

@madskristensen

When we map the subdomain json.schemastore.org then we need a redirection rule somewhere such that https://json.schemastore.org/appveyor will resolve to the right path for https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/appveyor.json. Do you know how to create that redirection rule @hyperupcall?

In cli.js, in the task that generates the website for GitHub pages for the file ./src/schemas/json/appveyor.json, it creates both a ./website/appveyor.json and a ./website/appveyor file. This matches the previous behavior where accessing both https://json.schemastore.org/appveyor and https://json.schemastore.org/appveyor.json returns the Appveyor json schema. Is there something I'm missing or does this address your comment?

DNS is now moved for schemastore.org and www.schemastore.org. There is no styling on the site, since only the index.html file is written. Could we create the website folder with all the assets (png, js, css) and then copy that entire folder in cli.js?

Noted, I made the fix for that in #4766

@madskristensen

Copy link
Copy Markdown
Contributor

@hyperupcall excellent work on this!

Is there something I'm missing or does this address your comment?

I missed that part. I've now updated DNS CNAME entry to point to this new location. Once it propagates, we should see it working

@madskristensen

Copy link
Copy Markdown
Contributor

@hyperupcall the DNS is now fully propagated (for my location at least) and everything seems to work correctly. Traffic to the old host is plummeting rapidly and will be zero in a matter of hours, I believe. This was a well executed project. Thank you so much for your effort.

@madskristensen

Copy link
Copy Markdown
Contributor

...now the json.schemastore.org subdomain isn't working. This is not easy nor well documented by GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI ".github/**/*" folder is updated (auto-generated by labeler action) cli.js Changes to the build system / JavaScript.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants