Skip to main content

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.
  1. Create a directory called .github/workflows in your project.
  2. In the .github/workflows directory, create a file named beam-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:
app.py
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:
beam-actions.yml
When you push to either main or staging, a new app will be deployed for each push: