Skip to content

Latest commit

 

History

History
138 lines (102 loc) · 4.07 KB

File metadata and controls

138 lines (102 loc) · 4.07 KB

CNAP Actions

CNAP Actions

Reusable GitHub Actions workflows for CNAP deployment

Quick Start

Deploy your application with zero configuration:

name: CNAP Build & Deploy
on: { push: { branches: [main] }, workflow_dispatch: }

jobs:
  cnap:
    uses: cnap-tech/actions/.github/workflows/cnap.yml@main
    permissions: { contents: read, packages: write, id-token: write }
    secrets: inherit

Features

  • Zero Configuration - Automatic language detection and build setup
  • Multi-Language Support - Node.js, Python, Go, Rust, and more
  • Container Ready - Automatic Docker image creation and registry push
  • Secure - Built-in OIDC authentication and secret management

Configuration

Parameter Description Required Default
build-context Directory containing your application code No ./
build-command Override the detected build command No Auto-detected
start-command Override the detected start command No Auto-detected
build-apt-packages Additional apt packages for build time No None
runtime-apt-packages Additional apt packages for runtime No None

Examples

Custom Build Context

name: CNAP Build & Deploy
on: { push: { branches: [main] }, workflow_dispatch: }

jobs:
  cnap:
    uses: cnap-tech/actions/.github/workflows/cnap.yml@main
    permissions: { contents: read, packages: write, id-token: write }
    secrets: inherit
    with:
      build-context: './apps/api'

Python with Dependencies

name: CNAP Build & Deploy
on: { push: { branches: [main] }, workflow_dispatch: }

jobs:
  cnap:
    uses: cnap-tech/actions/.github/workflows/cnap.yml@main
    permissions: { contents: read, packages: write, id-token: write }
    secrets: inherit
    with:
      build-apt-packages: 'python3-dev libpq-dev'
      runtime-apt-packages: 'postgresql-client'

Monorepo

name: CNAP Build & Deploy
on: { push: { branches: [main] }, workflow_dispatch: }

jobs:
  deploy-api:
    uses: cnap-tech/actions/.github/workflows/cnap.yml@main
    permissions: { contents: read, packages: write, id-token: write }
    secrets: inherit
    with:
      build-context: './apps/api'

  deploy-web:
    uses: cnap-tech/actions/.github/workflows/cnap.yml@main
    permissions: { contents: read, packages: write, id-token: write }
    secrets: inherit
    with:
      build-context: './apps/web'

Supported Languages

How It Works

  1. Checkout - Code is checked out from repository
  2. Detection - Railpack analyzes project and detects language/framework
  3. Configuration - Build and runtime settings are automatically configured
  4. Build - Application is built using Railpack
  5. Package - Production-ready Docker image is created
  6. Push - Image is pushed to GitHub Container Registry
  7. Notify - CNAP is automatically notified of the new image

Contributing

Contributions are welcome. Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made by the CNAP team

WebsiteDocumentationSupport