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
- Login to your Onboardbase account as an admin
- Click the profile icon in the navbar
- Scroll to the Service Token section
- Click Generate token button
- Enter the name of the service
- 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:
steps:
- run: echo $SECRET_ENV_VARIABLE
env:
SECRET_ENV_VARIABLE : test
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]
env:
ONBOARDBASE_TOKEN: ${{secrets.ONBOARDBASE_TOKEN}}
jobs :
test :
steps :
- name : Install Onboardbase CLI
run : |
# installs and configure onboardbase it using ONBOARDBASE_TOKEN env set from above.
# checkout https://github.com/Onboardbase/onboardbase.sh for reference
curl https://files.onboardbase.com/install.sh | bash - && source ~/.bashrc
- 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"
Updated 4 months ago