CloudCannon - How to split a site from Dev site
Log into GitHub and proceed to follow the steps below.
#1. Generate a new Classic tokem
Navigate to Profile > Settings > Develop Settings > Personal Access Tokens > Tokens (classic)
Click "Generate new token" and select "Generate new token (classic).
Fill in the note with anything really - i usually do the repo name, and then tick every box on the page and click "Generate token" at the bottom.
Copy the token.
2. Clone out Dev site into a new repository
Navigate to the "Import Repository" page:
If cloning from the For Purpose "Dev Site" Cloud Cannon site
The URL for your source repository
Paste in the following URL:
Your username for your source repository
Your GitHub username (ex: fenderic)
Your access token or password for your source repository
Paste in the classic token you generated in Step 1.
Your new repository details
Owner
Will default to your username - change it to ForPurposeNZ
Repository name
Name it after the client site (ex: carosika or kaitiaki-kindergartens)
Change the radio button from Public to Private.
Click the green Begin import button.
Test that the new repo builds
Once created - we want to clone the repository to your local machine and make sure that everything builds ok.
In GitHub Desktop app:
Open the GitHub Desktop app.
Repositories > Add > Clone a Repository > GitHub.com > select your repository you just created.
Alternatively - Using CLI command:
gh repo clone ForPurposeNZ/YOUR-NEW-CLOUDCANNON-REPOSITORY
In Visual Studio Code:
Open the folder of the new repo
Build and make sure everything is running locally.
npm install
npm start
Add new site to CloudCannon
In CloudCannon - https://app.cloudcannon.com/45122/editor#sites
- "+ Add new site"
- "Build with your own files"
- Site name: *Name of your site*
- File source: *Select your new repository*
- Click "Sync Files" button
- wait....
Boom - should be all good