Skip to content

How to add documentations to dev.loklak.org

Muhammad Kaisar Arkhan edited this page Apr 17, 2017 · 1 revision

Preparing

  1. Make sure the documentation is a static website and it’s located in a separated branch in the repository.

  2. Make sure the project has continuous integration and can encrypt/decrypt files to hold the SSH key

  3. Make sure the SSH key that will be used is added to loklak/dev.loklak.org as a "Deploy Key"

Setting up deployment of documentation to dev.loklak.org

  1. Add project’s documentation branch to config.csv. Please use SSH git repository URL instead of https or git.

  2. Add the following script to the project’s CI for dev.loklak.org update trigger

    #!/bin/sh
    
    # dev.loklak.org Update trigger script
    
    # This script is used to trigger the update process
    # of dev.loklak.org
    
    WORK="/path/to/working/directory"
    REPO="loklak/dev.loklak.org"
    PRIVATE_KEY="/path/to/decrypted/ssh/key"
    
    echo "Preparing ssh agent ..."
    eval $(ssh-agent -s)
    ssh-add $PRIVATE_KEY
    
    echo "Preparing git ..."
    git config --global user.email "travis@travis-ci.org"
    git config --global user.name "travis-ci"
    
    echo "Cloning repository ..."
    git clone --quiet --branch=gh-pages "git@github.com:$REPO.git" "$WORK"
    cd "$WORK"
    
    echo "Running pull script ..."
    ./.ci/pull.sh config.csv
    
    echo "Pushing changes ..."
    git push -f origin gh-pages