Github Actions

Use Onboardbse in your Github Actions

In this tutorial, we show how to integrate Onboardbase in your GitHub Actions pipeline. The same process can be applied to any CI/CD platform of your choice.

1. Create an Onboardbase service token

  1. Login to your Onboardbase account as an admin
  2. Click the profile icon in the navbar
  3. Scroll to the Service Token section
  4. Click Generate token button
  5. Enter the name of the service
  6. Click on Generate to finalize

7; Finally, add your service token to your Github Actions repository secrets. Click on the Settings tab on the GitHub Repository. On the Settings Page, click on Security > Secrets > Actions and add your Onboardbase service token:

2. Setup Onboardbase in your Github Actions workflow

Let's take the following Github Actions workflow as an example:

name : GitHub actions test
on : [push]
jobs :
	test :
        env :
			SECRET_ENV_VARIABLE : test
		run : echo $SECRET_ENV_VARIABLE

Every time a push is made to the main branch, the workflow will be triggered and run the echo test command. Sweet and simple.

Integrating Onboardbase is no harder. You just need to add 2 steps to install and configure Onboardbase:

name : GitHub actions test
on : [push]
jobs :
	test :
		steps :
			- name : Install Onboardbase CLI
				run : |
                    wget https://onboardbase-cli.fra1.digitaloceanspaces.com/apt/onbardbase.deb
				    run sudo dpkg -i onboardbase.deb
			- name : Setup Onboardbase
				run : onboardbase config:set --token "${{secrets.ONBOARDBASE_TOKEN}}"
			- name : Run project
				run : onboardbase run -c "echo $SECRET_ENV_VARIABLE" --project "github actions test" -e "development"

First, we install Onboardbase’s debian package to the Github Actions server, then we use our Onboardbase token stored in Github Secrets to automatically configure your project environment variables. It’s the only credential you’ll need to deal―pretty convenient!

Finally, we run Onboardbase’s CLI run command to run scripts. The program prints the value of SECRET_ENV_VARIABLE stored in Onboardbase: “thisisthesecret”:

The workflow completes successfully!

All you have to do to adapt this example to your own workflow is to wrap commands relying on environment variables in onboardbase run:

- name : Run project
    run : onboardbase run -c "npm run build" --project "Javascript project" -e "production"