ZBook repositories can be configured for either manual or automatic synchronization. For manual synchronization, click on "Sync Repository" in the repository sidebar. For GitHub repositories, automatic synchronization can be achieved using GitHub Actions.
To configure GitHub Actions for ZBook repositories, you need to create a YAML file in the .github/workflows/
directory to define the automated CI/CD process. Here is an example GitHub Actions configuration for automatically synchronizing a ZBook repository:
Create a file named .github/workflows/main.yml
in the root directory of your ZBook repository. This file will contain the GitHub Actions configuration.
yaml
In the GitHub repository's Secrets, you need to configure the following variables:
Parameter | Description |
---|---|
ZBOOK_URI | The URI of the target API, e.g., https://zizdlp.com/api/sync |
ZBOOK_REPO_NAME | The name of the current project's repository, e.g., docs |
ZBOOK_USERNAME | The username, e.g., admin |
ZBOOK_SYNC_TOKEN | The synchronization token used for authentication, provided when the repository was created |
With this GitHub Actions configuration, when code is pushed to the main branch, a synchronization operation is automatically triggered to sync the code and related information to the specified target system. You can also trigger synchronization when commits are made to other branches by changing main
to the specified branch.