Skip to main content

Deploying Superblocks tools

Superblocks makes it easy to deploy and make changes available to all of your users. Use either manual or automated deployment methods to deploy seamlessly using your SDLC workflow.

When deploying in Superblocks, you'll choose a commit to deploy. This will designate that commit as the version of your code to serve to end-users. Once deployed, code is served through Superblocks Global Edge Network optimizing performance no matter where your users are located.

Deploy methods

warning

When using Source Control, only commits on the default branch of your repo can be deployed. Merge your changes to make them deployable.

Superblocks UI

Deploy committed changes

To deploy changes using the Superblocks UI:

  1. Click on the Version Control panel icon
  2. Scroll to the Committed changes section
  3. Click the menu icon for your commit
  4. Click Deploy
  5. Review the confirmation dialogue and click Deploy


Continuous Deployment

You can deploy changes continuously using your CI/CD tool of choice. Choose your CI/CD platform below for instructions on how to configure continuous deployment.

info

The examples below show how to deploy immediately after changes have been successfully synced back to Superblocks using CI. See your platforms docs to update your workflow to deploying on a schedule, manually, or on some other action.

  1. From your GitHub repo, click on the Actions tab
  2. Click New workflow
  3. At the top of the page select Set up a workflow yourself
  4. Copy and paste the following into the workflow file:
.github/superblocks_deploy.yaml
name: Deploy

on:
workflow_run:
workflows: ["Sync changes to Superblocks"]
types:
- completed

jobs:
deploy:
if: ${{ github.event.workflow_run.head_branch == 'main' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Deploy
uses: superblocksteam/deploy-action@v1
id: deploy
with:
token: ${{ secrets.SUPERBLOCKS_TOKEN }}
warning

Make sure to replace the conditional to your preferred deploy branch

Superblocks CLI

You can deploy directly from the command line using the Superblocks CLI. This method works whether your tools are connected to git or not. To use the CLI to deploy:

1. Install the CLI and login

# Install the Superblocks CLI globally
npm i -g @superblocksteam/cli

# Log in to the CLI
superblocks login

2. Export your tools

# Create a directory for you Apps, Workflows, and Jobs
mkdir superblocks_tools
cd superblocks_tools

# Export your tools
superblocks init [RESOURCE_URL]

3. Make changes to your resource

Make changes to your App, Workflow, or Job using the Superblocks UI. Use the Versions panel to create a new commit.

4. Deploy your changes

After creating a commit, you can deploy it using the CLI with the command:

superblocks deploy

By default, the deploy command will deploy the most recent commit on the default branch of your tool. You can also deploy a specific commit using the --commit-id flag.