Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Github Gitlab integration setup

Tyler Barnes edited this page Jan 12, 2019 · 3 revisions

In wp-config.php, add any of the following applicable lines.

// for Gitlab
// https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#doc-nav
define('WORDLIFY_GITLAB_API_TOKEN', 'your-api-token'); 
define('WORDLIFY_GITLAB_PROJECT_ID', 'your-project-id');

// for Github
// https://github.com/settings/tokens
define('WORDLIFY_GITHUB_API_TOKEN', 'your-api-token'); 
define('WORDLIFY_GITHUB_OWNER', 'your-github-username');
define('WORDLIFY_GITHUB_REPO', 'your-repo-name');

// for both
define('WORDLIFY_GIT_HOST', 'github'); // or "gitlab"
define('WORDLIFY_BRANCH', 'master'); // pick the main branch.

When you upload media files, they'll be commited to a temporary branch. Once you save a post or page, the branch will be automatically merged into your main branch. This prevents your CI pipeline from building your gatsby site every time you upload a media file.

You shouldn't ever manually edit and commit changes to the json files in your-gatsby-site/wordsby/data/*.json as this may cause a merge conflict when you try to save a post in WP.

If you have an existing site that you want to use wordsby with, you can copy/paste your WP uploads folder to your-gatsby-site/wordsby/uploads and commit the media files you've added.

Clone this wiki locally