logo

nscloud-setup

namespacelabs/nscloud-setup is a GitHub action configuring access to Namespace. After executing the action, other GitHub actions that access Namespace resources can be used. nscloud-setup also installs and configures the Namespace CLI nsc in your GitHub Actions workflow, allowing you to manually interact with Namespace.

Prerequisites

  1. Install the Namespace GitHub application.

    1. Open the Dashboard.
    2. On the Federation page, click on Connect Organization under Associated GitHub organizations section.
    3. In the pop-up window, select the organization to which you want to install the Namespace app.
    4. Finally, choose if you want to install the app to all repositories or just a selection.
  2. Grant id-token: write permissions to your workflow to allow GitHub Actions to authenticate with Namespace.

Namespace-managed GitHub Runners don't need id-token: write permissions. They are already authenticated with Namespace.

Details

Example

jobs:
  deploy:
    name: Ephemeral cluster
    runs-on: ubuntu-latest
    # These permissions are needed to interact with GitHub's OIDC Token endpoint.
    permissions:
      id-token: write
      contents: read
    steps:
      - uses: actions/checkout@v4
      - uses: namespacelabs/nscloud-setup@v0
      - name: Create an ephemeral Kubernetes cluster
        run: |
          nsc cluster create

Options

nscloud-setup has no parameters.

Outputs

registry-address

Endpoint address of your workspace's private Namespace Container Registry.