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
-
Install the Namespace GitHub application.
- Open the Dashboard.
- On the Federation page, click on Connect Organization under Associated GitHub organizations section.
- In the pop-up window, select the organization to which you want to install the Namespace app.
- Finally, choose if you want to install the app to all repositories or just a selection.
-
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.
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.