Example for creating and publishing an instance of Catalog using Github Pages.
- Create a new Catalog following these instructions.
- Create a new repository on Github following these instructions.
- Add your Catalog code to the new repository following these instructions.
For more details about how to use Catalog, check out the documentation.
- Setup Github Pages on the
Settings
page of your Github repository. - Select the
/doc
folder of themaster
branch as the source for your Github Pages.
You can build Catalog locally and then publish a new version manually whenever you’re ready.
- Build your Catalog locally using the script
catalog-build --public-url=/[your-repo-name]/ --out=docs
. - Push the code changes to your repository on Github.
- Navigate to
https://[your-username].github.io/[your-repo-name]/
to see your new Catalog in full bloom.
Alternatively, you can build Catalog automatically whenever you push changes to your repository using Github Actions.
- Setup a new workflow on the
Actions
page of your Github repository. - Skip the template selection and set up a fresh workflow for yourself.
- Give your workflow a descriptive name (i.e.
build-and-deploy-catalog.yml
). - Copy and paste the following workflow.
- Save the workflow with Start commit to commit the workflow file to your repository.
- Navigate to
Actions
page of your repository to see your new workflow listed. - Make and commit a code change to your Catalog to see your publication workflow in action).
- From now on, every new code change that you push to the
master
branch will publish a new version of Catalog.
name: Build and Deploy Catalog
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install Catalog
run: yarn
- name: Set Environment Variable for Repository Name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")
shell: bash
- name: Echo Repository Name
run: echo "$REPOSITORY_NAME"
shell: bash
- name: Build Catalog
run: yarn catalog-build --public-url=/"$REPOSITORY_NAME"/ --out=docs
- name: Commit Changes
uses: elstudio/actions-js-build/commit@v3
with:
commitMessage: Build Catalog