CI/CD Setup
Welcome! This guide will help you set up automatic deployment for your Back4App project. When you're done, pushing code to GitHub will automatically update your Back4App app.
No prior experience with GitHub Actions is required.
Table of Contents
- What Does This Do?What Does This Do?
- What You'll NeedWhat You'll Need
- Step 1: Clone Your RepositoryStep 1: Clone Your Repository
- Step 2: Set Up Back4App CLI and Project StructureStep 2: Set Up Back4App CLI and Project Structure
- Step 3: Find Your Back4App App IDsStep 3: Find Your Back4App App IDs
- Step 4: Edit the Workflow FileStep 4: Edit the Workflow File
- Step 5: Add Your Secrets to GitHubStep 5: Add Your Secrets to GitHub
- Step 6: Create Your BranchesStep 6: Create Your Branches
- Step 7: Deploy!Step 7: Deploy!
- How to Use It DailyHow to Use It Daily
- TroubleshootingTroubleshooting
- GlossaryGlossary
ā ļøā ļøā ļø VERY IMPORTANT ā ļøā ļøā ļø
Though flexible and configurable, this Continuous Integration and Continuous Delivery (CI/CD) project is aimed at running Back4app Backend as a Service (BaaS) projects ONLY.
You might change it and adapt it to your specific needs, using this as a template, but have in mind that it does many checkings on Back4app's BaaS folders, files and settings, so ensure to adapt accordingly.
A few of those checks include:
- A configured Back4app Backend as a Service project, which you can obtain by using the Back4app Command Line Interface tool (CLI): https://www.back4app.com/docs/local-development/parse-cliWhat Does This Do?
This workflow automatically uploads your code to Back4App whenever you push changes to GitHub.
Here's how it works:
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā You push code ā āāā ā GitHub Actions ā āāā ā Back4App app ā
ā to GitHub ā ā runs workflow ā ā is updated ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāTwo distinct branches:
When you push to... | Your code goes to... |
|---|---|
development branch | Development Back4App app (for testing) |
main branch | Production Back4App app (for real users) |
This lets you test changes safely before releasing them to your users.
What You'll Need
Before starting, make sure you have:
A GitHub account with:
A Repository created for your App
Two branches named exactly development and main
A Back4App account
Two Back4App apps created:
One for Development (development and testing)
One for Production (live/real users)
Your project code in a GitHub repository
A code editor (like VS Code, Cursor, or even GitHub's web editor)
Don't have two Back4App apps yet?
You'll need to create them first:
- Log into Back4App
- Click the "New App" button on the top right side
- Create your first app and name it something like "DevelopmentApp"
- Create your second app and name it something like "ProductionApp"
Step 1: Clone Your Repository
Before you can add files to your project, you need to download (clone) your GitHub repository to your computer.
1.1 Find your repository URL
- Go to your repository on GitHub
- Open your web browser
- Go to github.com/YOUR-USERNAME/YOUR-REPO-NAME
- Click the green "Code" button
- It's near the top right of the file list
- Copy the URL
- Make sure "HTTPS" is selected (it's the default)
- Click the š copy button next to the URL
- The URL looks like: https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git
1.2 Clone the repository to your computer
š macOS
- Open Terminal
- Press Cmd + Space to open Spotlight
- Type "Terminal"
- Press Enter
- Navigate to where you want to store your project
# Go to your Documents folder (or wherever you want to work)
cd ~/Documents- Clone the repository
# Replace the URL with your actual repository URL
git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git- Enter the project folder
# Replace YOUR-REPO-NAME with your actual repository name
cd YOUR-REPO-NAME
š§ Linux
- Open your terminal
- Navigate to where you want to store your project
# Go to your home folder (or wherever you want to work)
cd ~- Clone the repository
# Replace the URL with your actual repository URL
git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git- Enter the project folder
# Replace YOUR-REPO-NAME with your actual repository name
cd YOUR-REPO-NAME
šŖ Windows (PowerShell)
- Open PowerShell
- Press Win + X
- Select "Windows PowerShell"
- Navigate to where you want to store your project
# Go to your Documents folder (or wherever you want to work)
cd ~\Documents- Clone the repository
# Replace the URL with your actual repository URL
git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git- Enter the project folder
# Replace YOUR-REPO-NAME with your actual repository name
cd YOUR-REPO-NAME
šŖ Windows (Command Prompt)
- Open Command Prompt
- Press Win + R
- Type "cmd"
- Press Enter
- Navigate to where you want to store your project
REM Go to your Documents folder (or wherever you want)
cd %USERPROFILE%\Documents- Clone the repository
REM Replace the URL with your actual repository URL
git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git- Enter the project folder
REM Replace YOUR-REPO-NAME with your actual repository name
cd YOUR-REPO-NAME
šŖ Windows (Git Bash)
If you installed Git for Windows, you have Git Bash which works like macOS/Linux:
- Open Git Bash
- Right-click on your Desktop or in a folder
- Select "Git Bash Here"
- Navigate to where you want to store your project
# Go to your Documents folder (or wherever you want)
cd ~/Documents- Clone the repository
# Replace the URL with your actual repository URL
git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git- Enter the project folder
# Replace YOUR-REPO-NAME with your actual repository name
cd YOUR-REPO-NAME
1.3 Verify the clone worked
After cloning, you should see your project files. Run this command to check:
ls -laOn Windows Command Prompt, use:
dirYou should see your project files listed, including any existing files from your repository.
1.4 Open the project in your code editor
š VS Code or Cursor
Option A: From the terminal
# Opens VS Code in current folder
code .
# Opens Cursor in current folder
cursor .Option B: From the application
- Open VS Code or Cursor
- Click File ā Open Folder
- Navigate to your project folder
- Click Open

š Other editors
- Open your code editor
- Look for File ā Open or File ā Open Folder
- Navigate to the folder where you cloned your repository
- Open it

Step 2: Set Up Back4App CLI and Project Structure
Before adding the workflow file, you need to set up the Back4App Command Line Interface (CLI) and connect it to your Back4App apps. This will create the necessary cloud folder structure in your project.
2.1 Install the Back4App CLI
The CLI lets you manage your Back4App apps from your terminal.
š macOS
Prerequisites: You need Python installed on your Mac (it usually comes pre-installed).
- Open Terminal (press Cmd + Space, type "Terminal", press Enter)
- Run the installation command:
curl https://raw.githubusercontent.com/back4app/parse-cli/back4app/installer.sh | sudo /bin/bash- Enter your password when prompted (you won't see characters as you type - that's normal)
- Verify the installation:
b4a --version- You should see a version number.

š§ Linux
Prerequisites: You need Python installed.
- Open your terminal
- Run the installation command:
curl https://raw.githubusercontent.com/back4app/parse-cli/back4app/installer.sh | sudo /bin/bash- Enter your password when prompted
- Verify the installation:
b4a --version
šŖ Windows
- Download the CLI executable:
- Download the file named b4a.exe
- Move the file to make it accessible globally:
- Move b4a.exe to C:\Windows\System32\
- (You may need administrator permission)
- Verify the installation:
- Open Command Prompt or PowerShell
- Run:
b4a --version
2.2 Get Your Back4App Account Key
You need an Account Key to connect the CLI to your Back4App account.
- Log into Back4App at back4app.com
- Click on your profile icon (top-right corner of the dashboard)
- Look for "Account Keys" in the menu
- Give your Account Key a name and click the "+" button on the right side
- A new Account Key will be created - Copy your new key immediately
Write it down somewhere safe:
My Account Key: ________________________________2.3 Configure the CLI with Your Account Key
Now connect the CLI to your Back4App account.
- Open your terminal and navigate to your project folder:
cd /path/to/your-project- Run the configuration command:
b4a configure accountkey- Paste your Account Key when prompted and press Enter
š” Note: If you've configured a key before and need to update it, use:
b4a configure accountkey -d2.4 Link Your Back4App App to Your Local Project
This step creates the Back4App cloud code structure inside your cloned repository.
- Make sure you're in your cloned repository folder:
# Navigate to your cloned repo (the folder from Step 1)
cd ~/Documents/YOUR-REPO-NAME
# Verify you're in the right place (should show .git folder)
ls -la- Run the new app command:
b4a new- When prompted, choose to link an existing app:
- You'll see options like (n)ew or (e)xisting
- Type e and press Enter to link an existing app
- Select your DEVELOPMENT app from the list
- Use the project's number to choose
- Press Enter to select
- When asked for "Directory Name:"
- Just press Enter to accept the default (uses your app name)
- Or type a simple name like app and press Enter
- The CLI will create a subfolder with this name
- When asked about blank project:
Please type "(b)lank" if you wish to setup a blank project, otherwise press ENTER:- Just press Enter to get the default template with sample files
- The CLI creates the files in a subfolder:
your-project/ ā Your cloned repo
āāā .git/ ā Already exists from Step 1
āāā MyApp/ ā Subfolder created by CLI (name may vary)
āāā cloud/
ā āāā main.js
āāā public/
ā āāā index.html
āāā .parse.local
āāā .parse.project2.4.1 Move Files to Repository Root
The workflow expects the cloud folder to be in the root of your repository, not in a subfolder.
Follow these steps:
Step A: First, find out what the subfolder is called:
lsYou'll see something like:
MyApp(The name will be whatever your Back4App app is called)
Step B: Run these 4 commands one by one, replacing MyApp with the name you saw above:
š macOS / š§ Linux / Git Bash
mv MyApp/* .mv MyApp/.parse.local .mv MyApp/.parse.project .rmdir MyApp
šŖ Windows (PowerShell)
Move-Item -Path "MyApp\*" -Destination "."Move-Item -Path "MyApp\.parse.local" -Destination "."Move-Item -Path "MyApp\.parse.project" -Destination "."Remove-Item -Path "MyApp"
šŖ Windows (Command Prompt)
move MyApp\* .move MyApp\.parse.local .move MyApp\.parse.project .rmdir MyApp
Step C: Verify it worked:
ls -laYou should see cloud/ and public/ folders in the root (not inside a subfolder).
- After moving, your repository should look like this:
your-project/ ā Your cloned repo
āāā .git/ ā Git directory (from Step 1)
āāā cloud/
ā āāā main.js ā Your Cloud Code goes here
āāā public/
ā āāā index.html ā Optional: web hosting files
āāā .parse.local ā App configuration
āāā .parse.project ā Project configuration2.5 Create the GitHub Workflows Folder
Now add the folder for GitHub Actions.
š macOS / š§ Linux
# You should already be in your cloned repo folder from Step 1
# If not, navigate to it:
cd ~/Documents/YOUR-REPO-NAME
# Verify you're in a git repository (should show your branch name)
git status
# Create the workflows folder
mkdir -p .github/workflows
šŖ Windows (PowerShell)
# You should already be in your cloned repo folder from Step 1
# If not, navigate to it:
cd ~\Documents\YOUR-REPO-NAME
# Verify you're in a git repository (should show your branch name)
git status
# Create the workflows folder
New-Item -ItemType Directory -Force -Path ".github\workflows"
šŖ Windows (Command Prompt)
REM You should already be in your cloned repo folder from Step 1
REM If not, navigate to it:
cd %USERPROFILE%\Documents\YOUR-REPO-NAME
REM Verify you're in a git repository (should show your branch name)
git status
REM Create the workflows folder
mkdir .github\workflows
š Using VS Code or Cursor
- Open your cloned repository folder in VS Code or Cursor (the one from Step 1)
- In the Explorer sidebar (left panel), right-click on empty space
- Select "New Folder"
- Name it .github (yes, with the dot at the beginning)
- Right-click on the .github folder
- Select "New Folder"
- Name it workflows

2.6 Add the Workflow File
Download the the simpleDeploy.yaml file from here:
and copy it into the .github/workflows/ folder.
2.7 Verify Your Project Structure
After completing this step, your cloned repository should look like this:
your-project/ ā This is your cloned repo folder
āāā .git/ ā Git directory (ESSENTIAL - created when you cloned)
āāā .github/
ā āāā workflows/
ā āāā simpleDeploy.yaml ā The deployment workflow
āāā cloud/
ā āāā main.js ā Your Cloud Code
āāā public/ ā (Optional) Web hosting files
ā āāā index.html
āāā .parse.local ā Back4App app config
āāā .parse.project ā Back4App project config
āāā ... (your other files)ā ļø Don't see the .git folder?
- On macOS/Linux: Hidden folders (starting with .) may not show by default. Run ls -la in terminal to see them.
- On Windows: Enable "Show hidden files" in File Explorer settings.
- If .git is truly missing: You're not in the cloned repository! Go back to Step 1 and clone your repo properly.
Step 3: Find Your Back4App App IDs
You need to find the Application ID for each of your two Back4App apps.
What is an Application ID?
It's a unique code that identifies your app. It looks something like this:
JrOq8xfZSBWLxC1oD1aBr94gGVTV11Axo12kyus0How to find it:
- Log into Back4App at back4app.com
- Click on your DEVELOPMENT app from the dashboard
- In the Overview tab (on the left side), look for App ID (on the right side)
- Copy the "App ID" value
Write it down or paste it somewhere safe:
My Development App ID: ________________________________- Go back to the dashboard and repeat for your PRODUCTION app:
My Production App ID: ________________________________Step 4: Edit the Workflow File
Now you'll put your App IDs into the workflow file.
4.1 Open the file
Open .github/workflows/simpleDeploy.yaml in your code editor.
4.2 Find lines 38-39
Look for this section near the top of the file:
env:
# āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
# ā EDIT THESE VALUES - Replace with your actual Back4App Application IDs ā
# āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
DEVELOPMENT_APP_ID: "YOUR_DEVELOPMENT_APP_ID_HERE"
PRODUCTION_APP_ID: "YOUR_PRODUCTION_APP_ID_HERE"4.3 Replace the placeholder values
Change the placeholder text to your actual App IDs:
Before:
DEVELOPMENT_APP_ID: "YOUR_DEVELOPMENT_APP_ID_HERE"
PRODUCTION_APP_ID: "YOUR_PRODUCTION_APP_ID_HERE"After (example):
DEVELOPMENT_APP_ID: "JrOq8xfZSBWLxC1oD1aBr94gGVTV11Aks8ur08Kk"
PRODUCTION_APP_ID: "v9pS0Ps4VTBwnVISz0TaVQ7vyDXVc8Alo42K096B"4.4 Save the file
Press Ctrl + S (Windows/Linux) or Cmd + S (Mac) to save.
Step 5: Add Your Secrets to GitHub
Secrets are like passwords - they're kept hidden and secure. You need to add two secrets to your GitHub repository.
What secrets do you need?
Secret Name | What It Is |
|---|---|
BACK4APP_EMAIL | The email address you use to log into Back4App |
BACK4APP_ACCOUNT_KEY | A special key from your Back4App account settings |
5.1 Find your Back4App Account Key
If you already created an Account Key in Step 2.2, you can use the same one. Otherwise:
- Log into Back4App at back4app.com
- Click on your profile icon (top-right corner of the dashboard)
- Look for "Account Keys" in the menu
- Give your Account Key a name and click the "+" button on the right side
- Copy your new key immediately
5.2 Add secrets to GitHub
- Go to your repository on GitHub
- Open your web browser
- Go to github.com/YOUR-USERNAME/YOUR-REPO-NAME
- Click the "Settings" tab
- It's in the top menu bar of your repository
- (You need to be the owner or have admin access)
- Find "Secrets and variables" in the left sidebar
- Click on it to expand
- Click on "Actions"
- Add the first secret (BACK4APP_EMAIL)
- Click the green "New repository secret" button
- Name: Type BACK4APP_EMAIL (exactly like this, all capitals)
- Secret: Type your Back4App email address
- Click "Add secret"
- Add the second secret (BACK4APP_ACCOUNT_KEY)
- Click "New repository secret" again
- Name: Type BACK4APP_ACCOUNT_KEY (exactly like this, all capitals)
- Secret: Paste your Back4App Account Key
- Click "Add secret"
5.3 Verify your secrets
After adding both secrets, you should see them listed:
Repository secrets
āāāāāāāāāāāāāāāāāā
BACK4APP_ACCOUNT_KEY Updated just now
BACK4APP_EMAIL Updated just nowStep 6: Create Your Branches
The workflow uses two branches: development and main.
What are branches?
Think of branches like parallel versions of your project:
- development - Where you test new features
- main - The stable version for real users
Check if you already have these branches
š„ļø Using Terminal/Command Line
# Navigate to your project
cd your-project
# See all your branches
git branch -aLook for development and main in the list.

š Using GitHub Website
- Go to your repository on GitHub
- Click the branch dropdown (usually says "main" or "master")
- See if development and main are listed

Create missing branches
If you need to create the branches:
Create the 'development' branch
# Make sure you're in your project folder
cd your-project
# Create and switch to development branch
git checkout -b development
# Push it to GitHub
git push -u origin development
Create the 'main' branch
# Create and switch to main branch
git checkout -b main
# Push it to GitHub
git push -u origin main
ā ļø About "master" vs "main"
Some older repositories use master instead of main. This workflow uses main.
If your repository has master but not main, you have two options:
Option A: Rename master to main
git branch -m master main
git push -u origin mainOption B: Edit the workflow file to use master instead of main:
Find this section in simpleDeploy.yaml:
on:
push:
branches:
- development
- mainChange main to master:
on:
push:
branches:
- development
- masterStep 7: Deploy!
You're all set up! Now let's test it.
7.1 Commit and push your changes
# Add all your changes (including the workflow file)
git add .
# Create a commit
git commit -m "Add deployment workflow"
# Push to development branch first (for testing)
git checkout development
git push origin development7.2 Watch the magic happen
- Go to your repository on GitHub
- Click the "Actions" tab
- You should see a workflow running!
The workflow will show each step as it runs:
- ā Green checkmark = Step completed successfully
- š Yellow spinner = Step is running
- ā Red X = Step failed (click to see what went wrong)
7.3 Check the results
If everything worked, you'll see:
ā
DEPLOYMENT COMPLETE!And your Back4App Development app will have your latest code!
How to Use It Daily
Once set up, using this workflow is simple:
For everyday development:
# Make your changes to the code
# Then:
git add .
git commit -m "Describe what you changed"
git push origin developmentā This deploys to your Development Back4App app
When you're ready to release to users:
# Switch to main branch
git checkout main
# Merge your tested changes from development
git merge development
# Push to main
git push origin mainā This deploys to your Production Back4App app
Quick reference:
Action | Command | Result |
|---|---|---|
Test new code | git push origin development | Updates Development app |
Release to users | git push origin main | Updates Production app |
Troubleshooting
ā "DEVELOPMENT_APP_ID has not been configured!"
What it means: You didn't edit the workflow file with your App IDs.
How to fix:
- Open .github/workflows/simpleDeploy.yaml
- Find lines 38-39
- Replace YOUR_DEVELOPMENT_APP_ID_HERE with your actual App ID
- Save, commit, and push again
ā "BACK4APP_EMAIL secret is not set!"
What it means: GitHub can't find the secret you were supposed to add.
How to fix:
- Go to your repo on GitHub ā Settings ā Secrets and variables ā Actions
- Check if BACK4APP_EMAIL exists (exact spelling, all capitals)
- If not, add it (see Step 5Step 5)
ā "BACK4APP_ACCOUNT_KEY secret is not set!"
What it means: Same as above, but for the account key.
How to fix:
- Go to your repo on GitHub ā Settings ā Secrets and variables ā Actions
- Check if BACK4APP_ACCOUNT_KEY exists
- If not, add it (see Step 5Step 5)
ā Workflow doesn't run when I push
Possible causes:
- Wrong branch name: The workflow only runs on development and main. Check your branch:
git branch- Workflow file in wrong location: It must be at exactly:
.github/workflows/simpleDeploy.yaml- YAML syntax error: Make sure you didn't accidentally break the file format when editing.
ā "b4a deploy" fails
Possible causes:
- Wrong App ID: Double-check that you copied the correct Application IDs
- Wrong Account Key: Your account key might be incorrect or expired
- No permission: Make sure your Back4App account has access to both apps
ā Health check shows unexpected response
What it means: The deployment probably worked, but the verification step got an unusual response.
This is usually okay! The important thing is whether the "Deploy to Back4App" step succeeded.
Check your Back4App dashboard to confirm the deployment worked.
I need more help!
If you're stuck:
- Read the error message carefully - It usually tells you exactly what's wrong
- Check the Actions tab on GitHub - Click on the failed run, then click on the failed step to see details
- Compare your setup with this guide step-by-step
- Ask for help - Include the exact error message when asking
Glossary
New to some of these terms? Here's what they mean:
Term | What It Means |
|---|---|
Branch | A separate version of your code. Like having a "draft" and a "final" copy. |
Commit | A saved snapshot of your changes, with a message describing what you did. |
Push | Uploading your commits from your computer to GitHub. |
Repository (Repo) | Your project's home on GitHub - contains all your code and history. |
Workflow | An automated process that runs when something happens (like pushing code). |
Secret | A hidden value (like a password) stored securely in GitHub. |
Application ID | A unique code that identifies your Back4App app. |
Account Key | A password-like code that proves you own your Back4App account. |
Cloud Code | JavaScript code that runs on Back4App's servers. |
CLI | Command Line Interface - a way to control programs by typing commands. |
Summary Checklist
Use this checklist to make sure you've completed everything:
Created .github/workflows/ folder in your project
Copied simpleDeploy.yaml into that folder
Found your Development App ID from Back4App
Found your Production App ID from Back4App
Edited simpleDeploy.yaml with both App IDs (lines 38-39)
Added BACK4APP_EMAIL secret to GitHub
Added BACK4APP_ACCOUNT_KEY secret to GitHub
Created development branch (or confirmed it exists)
Created main branch (or confirmed it exists)
Pushed code and saw the workflow run successfully
Once all boxes are checked, you're done! š
What's Next?
Now that you have automatic deployments working, you might want to:
- Set up branch protection - Prevent accidental pushes to main
- Add collaborators - Let team members push code too
- Try the advanced workflow - Check out deploy.yaml for more features like:
- Automatic code linting (ESLint)
- Code formatting (Prettier)
- Running tests (Jest)
- More than 2 environments
Congratulations on setting up your first CI/CD pipeline! š
CI/CD = Continuous Integration / Continuous Deployment - fancy words for "automatically test and deploy code"