You can use GitHub Actions to automatically build and release your components as part of your workflow. This can be used to update your Nuon applications, running in customer accounts alongside updating other platforms.

We offer the following actions:

Each GitHub action uses the Nuon CLI to perform operations. Please refer to configuration for details on configuring each action.

Automatically Build Components

In order to update customer applications with the latest version of a component, it must be built first. You can automatically build a component using GitHub actions.

To automatically build from an Action:

---
on:
  push:
    branches:
      - main
jobs:
  build:
    runs-on: ubuntu-latest
    name: Build
    steps:
      - name: Checkout code
        id: checkout
        uses: actions/checkout@v2

      - name: Build component
        id: build
        uses: nuonco/actions-build@v1
        with:
          api_token: ${{ secrets.nuon_api_token }}
          org: ${{ vars.nuon_org_id }}
          component_id: backend

Automatically Release Components

Release are used to update components in a Nuon application.

To automatically build and release a component from an Action:

---
on:
  push:
    branches:
      - main
  build:
    runs-on: ubuntu-latest
    name: Build
    steps:
      - name: Checkout code
        id: checkout
        uses: actions/checkout@v2

      - name: Build component
        id: build
        uses: nuonco/actions-build@v1
        with:
          api_token: ${{ secrets.nuon_api_token }}
          org: ${{ vars.nuon_org_id }}
          component_id: backend

      - name: Release
        id: release
        uses: nuonco/actions-release@v1
        with:
          api_token: ${{ secrets.nuon_api_token }}
          org: ${{ vars.nuon_org_id
          build_id: ${{ steps.build.outputs.build_id }}

Please refer to creating releases for more details on releases.

Configuration

Both an API token and an org ID are required to configure Nuon github actions.

It is recommended to set the API token using a GitHub Action secret.

If you do not yet have an org setup, please follow the quickstart guide.

API Tokens

If you are just trying out the Nuon Github Actions, then you can get started using your personal auth token:

nuon orgs api-token

For real use cases, we recommend using a static token. To request a static token, please contact us.