The biggest challenge, though, is finding an easy-to-use tool for handling such a structure. Monorepo architecture has become more popular over the years, which is understandable considering the problem it solves. This article was published on Nov 17, 2021, and takes approximately 11 minutes to read. Then you can access the deployment with your-domain.Replacing Lerna + Yarn with PNPM Workspaces If you have registered a custom domain you could also go to Domain management and click Add custom domain. Maybe I'm adding some styles to the demo soon so it's looking nicer.īut adding an automatic navigation generation to the theme would be probably better and more fun to build. The deployment of my demo can be found here. Now you can check your deployed demo at this page. Pick an available name for your page e.g. For renaming go to the Settings tab and there in General\Site details click Change site name. You could also use the generated name but it's difficult to remember. You probably want to change the site name. Public directory is still referenced from the root folder that's why we have to add the demo-basic to the path. You can add the same repository multiple times to Netlify as new site and customize the build so it's building the correct demo.īase directory will change the working directory to demo-basic and then run gatsby build. URL /demo-basic/ or /demo-advanced/įor the workaround, there will be a site in the Netlify app for each workspace. Not a great solution but it is working - ideally, this could be created from the TOML and also do an URL handling with the configuration e.g. So the only work-around I've found is to create different sites in the Netlify app and add the configuration manually like following: Netlify is just using the netlify.toml in the root directory and not respecting/handling TOML files in sub-directories. There is an open issue about the problem but no fix at the moment. Removing the TOML file is required because it would override the settings from the Netlify configuration that was added in the app. Why would you want multiple demos? I think it's good to have a minimal demo and one that is using every feature of your theme and maybe also other optional themes. demo-basic & demo-advanced) you have to remove the netlify.toml and do the configuration manually in the Netlify web app. If you'd like to deploy two or more demos (e.g. If not click on the deploy and check the error message. If everything is working as expected you should see a published badge (see below) on the last build in Deploys panel. This push will automatically trigger a CD and you can check the build in the Netlify web app. Now stage every change, commit it to Git and push to Github. Configure your repositoryĪdd a netlify.toml file with the following configuration to the root of your project: No other setup needed as we're using a netlify.toml file in the repository just linking the repo is enough. button on Netlify will be added to use continuous deployment. Because only the projects that you're adding with the New. I'm using just the repositories that I'd like to deploy with Netlify but it's probably also OK to allow all repos. Now select All repositories or limit access to some of your repositories. Pick the project from the list or the link below Configure the Netlify app on Github if you're not seeing your project. Configure Netlifyįirst, connect your Github repository to Netlify by login into Netlify and click on New site from Git on the Sites page.Ĭhoose Github for Continous Deployment (later also CD). You can have a look at github/awolf81/gatsby-theme-mdx-demo for the project setup. The setup is using yarn workspaces and the demo page will be located in the demo directory. I think it's pretty straight forward but probably worth-it to write about it. I deployed my first Theme demo on Netlify and I'd like to document how I've done it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |