Import your models from GitHub

by CommunityCAD · written by @milo · Intermediate · 15 min · 8 steps

Link a GitHub repo once and every push keeps your models on CommunityCAD up to date: folders become models, changed files become new versions.

Keep your CAD in a GitHub repo? Link it once and CommunityCAD follows it: every folder of CAD files becomes a model, and every push updates them. No more uploading by hand.

Step 1

Get your repo ready

You don't have to change anything, but a tidy repo gives tidy models. By default, each folder that holds CAD files becomes one model, and the folders above it become groups.

2020-frame-parts/
├── brackets/
│   ├── corner-bracket/
│   │   ├── README.md
│   │   ├── corner-bracket.step
│   │   └── stl/corner-bracket.stl
│   └── t-plate/
└── feet/levelling-foot/

Put a README.md in each model's folder: it becomes the model's page, and its first # heading becomes the title. Images become the gallery, PDFs become datasheets, and a LICENSE file sets the license.

Tip

Folders named stl, step, exports, images or docs belong to the model above them, so one project with an stl/ folder stays one model.

Step 2

Open Upload → Repo

The Repo tab of Upload, with the Connect GitHub button

Sign in, press Upload, and choose Repo at the top right.

The first time, you'll see Connect GitHub. Press it: GitHub asks you to install the CommunityCAD app on your account or organisation and to pick which repos it may see. Choose only the ones you want on CommunityCAD. You come straight back here.

Note

The app only reads your repos. It writes only if you ask it to open a pull request, and then only on a new branch of its own.

Step 3

Choose the repo

Step 1 of the wizard: a repo, branch main and an empty folder

Pick the repo, the branch to follow (usually main) and, if you only want part of it, a folder. Press Next and we read the repo.

Missing a repo? Use Change which repos CommunityCAD can see to share more of them on GitHub.

Step 4

Check what's in it

Step 2: the repo's folders, each with a role and a title; drafts is set to Leave out

Each folder with CAD files is listed with our guess: a model, a group that holds models, part of the model above, or leave out. Fix anything that's wrong and change titles while you're here.

Here, drafts holds unfinished work, so it's set to Leave out.

Step 5

Pick your settings

Step 3: Sourcing, models, removed folders and visibility

Choose how each model's Sourcing tab works (where to buy the parts it uses), whether you want one model per folder or one for everything, what happens when a folder is removed from the repo, and whether new models are public or private.

Tip

Let CommunityCAD add sources finds the parts your model uses and adds buy links that support CommunityCAD, at no cost to buyers. Your model gets a "Supports CommunityCAD" badge.

Step 6

Link and sync

Step 4: a summary and the three ways to save your choices
The repo is linked: 3 models added, and a pull request opened

Last, choose whether to save your choices in the repo as a communitycad.yml file. Open a pull request is the easy option: we open one, and you merge it when you like. Your choices apply from the first sync either way.

Press Link and sync. The first sync starts straight away, and the page shows it finishing.

Step 7

Push, and it updates

The GitHub tab on a profile, with one linked repo synced just now

That's it. From now on, each push to the branch you chose updates your models:

  • a new folder becomes a new model;
  • changed files make a new version of their model;
  • a renamed folder keeps its model, page, downloads and comments.

Manage linked repos on your profile's GitHub tab: see the last sync, press Sync now, run Set up again, Pause or Unlink.

Unlinking stops the sync; your models stay as they are. For every option, including communitycad.yml, see Sync from GitHub.