Skip to main content

Deploy your Spark app from the command line

Learn how to deploy your Spark app from the command line.

Who can use this feature?

Copilot Pro+, Copilot Enterprise

Introduction

If you’re developing your spark further in a GitHub codespace, you can deploy it directly from the command line using the Spark CLI, an extension of the GitHub CLI.

Prerequisites

Open your spark in a codespace

The Spark CLI currently only works within a GitHub codespace.

  1. Navigate to the main page of your spark's repository on GitHub.
  2. Click the Code button, then click the Codespaces tab.
  3. Click to create a codespace. The codespace opens in a new browser tab.

Install the Spark CLI

  1. In the terminal in your codespace, run the following command to install the Spark CLI:

    Bash
    gh extensions install github/gh-runtime-cli
    
  2. Once the installation is complete, to verify that the Spark CLI is installed, run:

    Bash
    gh runtime-cli version
    

Build your spark

  1. In the terminal in your codespace, run the following command to install the latest version of the Spark SDK:

    Bash
    npm install @github/spark@latest
    
  2. Next, run the following command to compile your Spark app.

    Bash
    npm run build
    

Deploy your spark

  1. To deploy your Spark app, run:

    Bash
    gh runtime-cli deploy --dir ./dist
    

Troubleshooting

If you're being asked to supply the --app parameter when deploying your spark, update to the latest version of the Spark SDK by following step 1 in Build your spark.