Skip to content

Kizuna Actions is a CI/CD system that's syntax-compatible with GitHub Actions. Use familiar YAML syntax to automate builds, tests, and deployments.

Workflow Files

Create workflow files in .kizuna/workflows/:

repo/
├── .kizuna/
│   └── workflows/
│       ├── ci.yml
│       └── deploy.yml
└── src/

Basic Workflow

yaml
# .kizuna/workflows/ci.yml
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          
      - name: Install dependencies
        run: npm ci
        
      - name: Run tests
        run: npm test

Triggers

Push Events

yaml
on:
  push:
    branches: [main, develop]
    paths:
      - 'src/**'
      - 'tests/**'

Pull Request Events

yaml
on:
  pull_request:
    types: [opened, synchronize, reopened]
    branches: [main]

Scheduled Events

yaml
on:
  schedule:
    - cron: '0 2 * * *'  # Daily at 2 AM

Manual Trigger

yaml
on:
  workflow_dispatch:
    inputs:
      environment:
        description: 'Environment to deploy'
        required: true
        default: 'staging'

Jobs

Single Job

yaml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run build

Multiple Jobs

yaml
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm test

  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm run lint

Job Dependencies

yaml
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm test

  deploy:
    needs: test  # Waits for test job
    runs-on: ubuntu-latest
    steps:
      - run: echo "Deploying..."

Runners

Available Runners

RunnerLabel
Ubuntu Latestubuntu-latest
Ubuntu 22.04ubuntu-22.04
Ubuntu 20.04ubuntu-20.04
Self-hostedself-hosted

Self-Hosted Runners

yaml
jobs:
  build:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v4
      - run: make build

Steps

Basic Step

yaml
steps:
  - name: Build
    run: npm run build

Multiple Commands

yaml
steps:
  - name: Setup
    run: |
      npm ci
      npm run migrate
      npm run seed

Conditional Steps

yaml
steps:
  - name: Deploy Production
    if: github.ref == 'refs/heads/main'
    run: npm run deploy:prod

Environment Variables

yaml
steps:
  - name: Test
    env:
      NODE_ENV: test
      API_KEY: ${{ secrets.API_KEY }}
    run: npm test

Secrets

Using Secrets

yaml
steps:
  - name: Deploy
    env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    run: |
      aws s3 sync ./dist s3://my-bucket

Setting Secrets

  1. Go to SettingsCI/CDSecrets
  2. Click New Secret
  3. Enter name and value
  4. Save

Caching

Cache Dependencies

yaml
steps:
  - uses: actions/checkout@v4
  
  - uses: actions/cache@v4
    with:
      path: ~/.npm
      key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
      restore-keys: |
        ${{ runner.os }}-node-
  
  - run: npm ci

Artifacts

Upload Artifacts

yaml
steps:
  - run: npm run build
  
  - uses: actions/upload-artifact@v4
    with:
      name: build-files
      path: dist/

Download Artifacts

yaml
jobs:
  deploy:
    needs: build
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: build-files
          path: dist/

Services

Using Services

yaml
jobs:
  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432
    steps:
      - run: npm test

Matrix Builds

Test Multiple Versions

yaml
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [18, 20, 22]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm test

Container Jobs

Run in Container

yaml
jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: node:20-alpine
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run build

Workflow Commands

Set Output

yaml
steps:
  - id: vars
    run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
  
  - run: echo "SHA is ${{ steps.vars.outputs.sha }}"

Set Environment Variable

yaml
steps:
  - run: echo "MY_VAR=value" >> $GITHUB_ENV
  - run: echo $MY_VAR

Add to PATH

yaml
steps:
  - run: echo "$HOME/.local/bin" >> $GITHUB_PATH

Mask Values

yaml
steps:
  - run: echo "::add-mask::$SECRET_VALUE"

Contexts

Available Contexts

ContextDescription
githubWorkflow run information
envEnvironment variables
jobCurrent job information
stepsStep outputs
runnerRunner information
secretsSecret values
varsConfiguration variables

Using Contexts

yaml
steps:
  - run: echo "Repository ${{ github.repository }}"
  - run: echo "Ref ${{ github.ref }}"
  - run: echo "Actor ${{ github.actor }}"

Debugging

Enable Debug Logging

Set secret ACTIONS_STEP_DEBUG to true.

View Logs

  1. Go to Pipelines in repository
  2. Click workflow run
  3. Expand job and steps

Migration from GitHub Actions

Most workflows work unchanged. Differences:

GitHubKizuna
GITHUB_TOKENKIZUNA_TOKEN
github.eventkizuna.event
actions/github-scriptkizuna/script

Summary

Kizuna Actions provides:

  • Familiar syntax — GitHub Actions compatible
  • Flexible triggers — Push, PR, schedule, manual
  • Job orchestration — Dependencies, matrices
  • Secret management — Secure variable storage
  • Artifact handling — Pass files between jobs

It's the automation engine for your CI/CD pipelines.