Skip to content

icdevsorg/juno-action

 
 

Repository files navigation

Juno Action

This GitHub Action for Juno enables arbitrary actions with the command-line client.

Authentication

The action supports two authentication methods:

1. GitHub OIDC (Recommended)

Authenticate automatically using GitHub's OpenID Connect tokens. No secrets required!

Requirements:

  • Add id-token: write permission to your workflow
  • Configure your Satellite to support automation

Example configuration:

import { defineConfig } from "@junobuild/config";

export default defineConfig({
  satellite: {
    ids: {
        development: "<DEV_SATELLITE_ID>",
        production: "<PROD_SATELLITE_ID>"
    },
    automation: {
      github: {
        repositories: [
          {
            owner: "your-org", // or user name, e.g. peterpeterparker
            name: "your-repo", 
            refs: [] // Optional: restrict to specific refs, e.g. ["refs/heads/main"]
          }
        ]
      }
    }
  }
});

Workflow example:

name: Deploy to Juno

on:
  workflow_dispatch:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest

    permissions:
      id-token: write  # Required for GitHub OIDC
      contents: read
    
    steps:
      - name: Check out the repo
        uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 24
          registry-url: "https://registry.npmjs.org"

      - name: Install Dependencies
        run: npm ci

      - name: Deploy to Juno
        uses: junobuild/juno-action
        with:
          args: hosting deploy

2. Token Authentication (Legacy)

Use a manually generated token from Juno's console. Prefer an access key with "Read-write" permission rather than administrator.

name: Deploy to Juno

on:
  workflow_dispatch:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repo
        uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 24
          registry-url: "https://registry.npmjs.org"

      - name: Install Dependencies
        run: npm ci

      - name: Deploy to Juno
        uses: junobuild/juno-action
        with:
          args: hosting deploy
        env:
          JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}

Configuration

  • PROJECT_PATH - Optional. The path to the folder containing juno.config.ts|js|json if it doesn't exist at the root of your repository. e.g. ./my-app.

Available Action Versions

You can choose from several action variants depending on your needs:

Version tag Description
@main or no tag Defaults to the slim image
@slim Explicitly use the slim image
@full Use the full image
@vX.Y.Z Specific version tag for slim
@vX.Y.Z-slim Versioned slim image
@vX.Y.Z-full Versioned full image

The slim image does not include the Rust toolchain or tools required to build serverless functions. It is smaller in size and suitable for most CLI use cases.

The full image includes the Rust toolchain and all necessary tools for building serverless functions, resulting in a larger image size.

License

MIT © David Dal Busco

About

GitHub Action for interacting with Juno

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 69.2%
  • Shell 24.6%
  • Slim 4.3%
  • Other 1.9%