Integrate into CI/CD
You can integrate Beam into an existing CI/CD process to deploy your code automatically.
Automated Deploys
It’s fairly straightforward to setup automation for deploying your code to Beam. At a high level, the following steps are all you need:
Example: Github Actions
You can setup a Github workflow to deploy your code whenever a new commit is made to your Git repo.
Setup Environment Variables
First, add your BEAM_TOKEN
to your Github Secrets:
Create Actions file
For a detailed walk-through of this step, Github’s documentation is the best resource.
- Create a directory called
.github/workflows
in your project. - In the
.github/workflows
directory, create a file namedbeam-actions.yml
Deploying to Different Environments
You might want to setup separate Beam apps for your staging
or prod
environments.
In your Beam app, you can setup your app name to dynamically update based on the Github branch you’ve deployed to. BEAM_DEPLOY_ENV
will get set in our Github Actions script, based on the branch name:
If you push to the main
branch, the app app-prod
will be deployed. If you push to the staging
branch, app-staging
will be deployed. You can customize this with your own branch names.
Here’s what the Github Action looks like. Make sure you’ve added a BEAM_TOKEN
to your Github Secrets:
When you push to either main
or staging
, a new app will be deployed for each push:
Was this page helpful?