I have ran into an interesting challenge for a documentation site that I am working on. The code repository is private on GitHub until it is ready to be made public, however needs to be be deployed publicly
Initially I started working with Jekyll deployment proved to be a challenge through GitHub pages and Netlify both of which required upgrades which the project could not justify
Thus I looked in the direction of Jigsaw by Tighten which I have wanted to try out in a long time. My reasoning being that since it was Laravel based, I would be able to deploy it leveraging my existing Laravel Forge subscription to a managed server, and voila all would be well.
I first struggled with getting Jigsaw to get configured to display the site – so I went back to the drawing board and came up with the following flow based
- Build a production static version of the site
- Deploy it to the gh-pages branch as per the instructions in https://jigsaw.tighten.com/docs/deploying-your-site/
- To automate this process I created a custom deploy action below
deploy": "npm run prod; deploy_time=$(date \"+%A %d-%B, %Y %H:%M:%S\") && git add build_production && git commit -m \"Build for deploy on $deploy_time\" && git subtree push --prefix build_production origin gh-pages
which combines all the commands to push to gh-pages - Create an HTML site on my VPS using Laravel Forge
- Link the gh-pages branch as the app to the site
- Enable quick deploy so that any changes to the gh-pages branch automatically deploys the new site
- Do not forget to setup SSL on the site (using the method of your choice)
So once I make changes to my site, I run npm run deploy
to push it into production …
One thought on “Deploying a Tighten Jigsaw static site to a VPS using Laravel Forge”