Deploy with GitHub Actions
Use the Reflex deploy action to deploy an app to Reflex Cloud from a GitHub Actions workflow.
This action requires
reflex>=0.6.6Usage
Add the Action to Your Workflow
Create a .github/workflows/deploy.yml file in your repository and add the following:
name: Deploy Reflex App
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to Reflex Cloud
uses: reflex-dev/reflex-deploy-action@v1
with:
auth_token: ${{ secrets.REFLEX_AUTH_TOKEN }}
project_id: ${{ secrets.REFLEX_PROJECT_ID }}
app_directory: "my-app-folder" # Optional, defaults to root
extra_args: "--region sjc" # Optional
python_version: "3.12" # OptionalSet Up Your Secrets
Store the Reflex authentication token and project ID as GitHub repository secrets:
- Go to your GitHub repository.
- Open Settings > Secrets and variables > Actions.
- From the organization's Tokens page, create a token from the Deploy template and limit it to the target project. Store it as
REFLEX_AUTH_TOKEN. See Tokens. - Create
REFLEX_PROJECT_IDwith the project ID copied from the project's settings in Reflex Build.