1.0.4 • Published 4 years ago

strapi-provider-upload-github v1.0.4

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

strapi-provider-upload-github

Github/Github-Pages provider for Strapi CMS file upload.

Installation

npm install strapi-provider-upload-github

Prerequisite

  • Make sure git is installed and accessable at runtime on server.
  • Avoid using code repo for uploading assets.
  • Given empty branch should not contain any files.

Config

./extensions/upload/config/config.json

{
      "provider": "github",
      "providerOptions": {
          "repo": "https://github.com/user-name/site-assets",
          "user": "user-name",
          "token": "***token***",
          "emptyBranch": "upload",
          "baseBranch": "master",
          "publicUrl": "https://user-name.github.io/site-assets",
          "sizeLimit": 1000000
      },
}

Parameters

  • repo - github repo link
  • user - github user name
  • token - github user token (Creating a personal access token - GitHub Docs)
  • emptyBranch - branch name with no files (Empty branch used to auto merge uploaded files without any conflicts).
  • baseBranch - branch name pointed to github pages.
  • publicUrl - github pages public url. (alternatively you can use public urls from vercel, surge, netlify)
  • sizeLimit - upload file size limit.

Resources

Links