Using the Git distributed version control system on your development and server environments, you can set up a simple workflow via a hosted Git service like Github or GitLab. Try this if you are comfortable with Git and its client tools.
Its benefits include:
A Git-based workflow requires some setup. Here is a broad overview of the configuration. Depending on whether you want to commit folders that contain third party code like
plugins, there may be some more steps when you first set it up on your server.
userfolder is a Git repository.
userfolder repository is also hosted in the cloud. Choose a provider that supports private repositories if you don't want to share your code with the world.
originon your Git cloud host.
userfolder is a clone of your remote repository.
After intial setup, you only really need to perform two steps after each significant update:
If you want more advanced automation, you can set up Git Hooks or use a feature like Github's webhooks. You could also integrate content changes from web editors making edits on their own installations through the Admin console. You can keep (almost) immutable records of what is published using Git tags.
The tools available support all kinds of multi-environment workflows and automations.
You can also exploit Git for your content workflow using the Git Sync plugin, so that your content editors can deploy changes via the Administration console.
Here is a suggestion for your
.gitignore file in your
user folder repository. This will help keep your deployment clean:
accounts/* !accounts/.* data/* !data/.* languages/* !languages/.* plugins/* !plugins/.* themes/* !themes/.* !themes/MY_CUSTOM_THEME/ **/config/security.yaml
If you are using a custom or inherited theme that you want to include in your source control, subsitute
MY_CUSTOM_THEME above with the theme name. Consider doing the same for any site-specific custom plugins.
Found errors? Think you can improve this documentation? Simply click the Edit link at the top of the page, and then the icon on Github to make your changes.
Powered by Grav + with by Trilby Media.