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 yourBEAM_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/workflowsin your project. - In the
.github/workflowsdirectory, create a file namedbeam-actions.yml
Deploying to Different Environments
You might want to setup separate Beam apps for yourstaging 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:
app.py
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:
beam-actions.yml
main or staging, a new app will be deployed for each push:
