Host Config on Github Pages
Use the tools you already know, with version control and automatic signing
For the quickest possible deployment, use our drag and drop signing tool, and a web host of your choosing.
Our suggested host for your config file is Github Pages. It has many benefits:
Familiar tools: Git and Github
Version control built-in
Access controls built-in
Branch protections to authorize who can deploy
Github Actions automate the signing process
Setup Repository
Create a repository to host your config file.
We suggest new dedicated repository used only for this and this guide section assumes that approach. Add your JSON config file as a file named config.json
in the root. See detailed instructions below if needed.
Alternatively: you could host host from your existing repository for your iOS codebase. Skip this step if you prefer that route. See the config options in Setup Automatic Signing for how to set the path to your config file, and how to specify which branch should be deployed.
Github Pages is only available on public repos, or private repos if you are a paid Github user.
If you are a free Github user, you can still use this approach with a public repository. As the config file is going to be on the public internet for customers to retrieve, you aren't exposing any additional data.
Add Custom Domain (optional)
Adding a custom domain will allow you to change to a different host at a later time, if you no longer want to use GitHub Pages as your host.
Setup Automatic Signing and Deployment
Github Actions can automatically sign and deploy your config file for you, each time you merge a change. This has the added benefit of checking for errors, and aborting the deployment if any issues are found.
Once your follow the detailed instructions above, check that the action was successful in Github's Actions UI.
Github Settings: Action Based Pages Build
In the github.com UI, open the repo's settings, then open the "Pages" tab. Set the "Source" to "Github Actions" as seen below
Don't skip this step, or builds may not work!
Confirm the Config is Online
Double check everything worked and your signed config file is accessible from the public internet!
Your signed config should now be online at your URL such as:
If you setup custom DNS:
https://democonfig.criticalmoments.io/cmConfigSigned.cmconfig
Or via direct Github URL:
https://criticalmoments.github.io/sample_app_config/cmConfigSigned.cmconfig
Fetch it using the tool of your choice (curl,
browser). You should be receive signed config file starting with -----BEGIN CM-----
Use your New Hosted Config
You can use this URL for your app release in your app delegate like so:
After setting the URL, you can test everything works in-app by running your app with a "Release" build configuration in it's Xcode scheme:
Setup Access Control and Branch Protections (optional, recommended)
Setup any access controls and branch protections you desire.
Since the Critical Moments config file can push messaging to your users in app, we suggest you require approvals before merging into the deployment branch (defaults to main branch), just as you would a any webpage.
Last updated