npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cdwr/nx-fly-deployment-action

v0.4.0

Published

The Nx Fly Deployment Action will manage your deployments to fly.io.

Readme

Description

This action will manage deployments to Fly.io of your Nx workspace applications.

Fits perfectly with Nx Pre-deploy Action for multi-tenant setups.

[!NOTE] Architecture, multi-tenant setup, and configuration See: DEPLOYMENT.md

Required Application Setup

Each deployable app requires:

  1. github.json - Deployment configuration in app root (optional postgres settings)
  2. Fly.io configuration - One of the following:
    • fly.{environment}.toml (e.g., fly.production.toml, fly.preview.toml)
    • fly.toml (default)
    • For existing apps: remote configuration will be automatically fetched and used

Fly Configuration Selection Logic

During deployment, the action uses this priority order:

  1. Existing apps: Saves and uses remote configuration from Fly.io
  2. New apps: Looks for environment-specific config (e.g., fly.production.toml)
  3. New apps: Falls back to fly.toml
  4. No config found: Deployment is skipped

[!TIP] To disable deployment for an app, remove or rename its Fly configuration file (e.g., rename to fly.local.toml for manual deployments).

Applications without a github.json file will be skipped during deployment.

[!NOTE] github.json schema, field descriptions, and examples See: Per-App Configuration in DEPLOYMENT.md

Usage

[!IMPORTANT] Using the action is currently limited to cloning this repository since the package isn't deployed according to action best practices.

We have a monorepo and are considering other options to make the action available to other repositories.

- uses: actions/checkout@v4
  with:
    fetch-depth: 0

# Install dependencies and tools...
# Build packages...

# Fly CLI must be installed
- name: Install Fly CLI
  uses: superfly/flyctl-actions/setup-flyctl@master
  with:
    version: 0.3.45

# Let Nx analyze which projects are affected and hence will be deployed
- name: Analyze affected projects to deploy
  uses: nrwl/nx-set-shas@v4
  with:
    set-environment-variables-for-job: true

- name: Run Nx Fly Deployment
  uses: ./packages/nx-fly-deployment-action
  with:
    fly-api-token: ${{ secrets.FLY_API_TOKEN }}
    token: ${{ secrets.GITHUB_TOKEN }}

Environment Determination

Environment is determined by the GitHub event:

  • Pull requests → preview
  • Push to main → production

Environment variables provided to deployed apps: DEPLOY_ENV, APP_NAME, PR_NUMBER, TENANT_ID

[!NOTE] Environment detection logic and affected apps analysis

See: Nx Pre-deploy Action

Inputs

See action.yaml for descriptions of the inputs.

Additional input details

app-details

Provide a JSON object that maps app names to their deployment configurations. This supports both multi-tenant deployments and multi-deployment scenarios (e.g., multiple environments). This is typically the output from the Nx Pre-deploy Action.

[!NOTE] Setting up multi-tenant configuration in Infisical See: Multi-tenant Setup Guide

Structure:

{
  "web": [
    {
      "tenant": "acme",
      "env": { "PUBLIC_URL": "https://acme.example.com" },
      "secrets": { "API_KEY": "sk_acme_..." }
    },
    {
      "tenant": "globex",
      "env": { "PUBLIC_URL": "https://globex.example.com" },
      "secrets": { "API_KEY": "sk_globex_..." }
    }
  ],
  "cms": [{ "tenant": "acme" }]
}

Behavior:

  • Each app is deployed once per deployment configuration
  • Apps get unique names: <base-app-name>-<tenant-id> (e.g., cdwr-web-acme, cdwr-web-globex)
  • The TENANT_ID environment variable is set for each deployment
  • Config merging: Global env/secrets are merged with deployment-specific config (deployment wins)
  • If no app-tenants provided, apps deploy once with only global config

Example usage:

- name: Deploy
  uses: ./packages/nx-fly-deployment-action
  with:
    app-details: ${{ needs.pre-deploy.outputs.app-tenants }}
    env: |
      GLOBAL_VAR=shared-value
    secrets: |
      SHARED_SECRET=xyz

In this example, GLOBAL_VAR and SHARED_SECRET are available to all deployments, but deployment-specific values take precedence if they have the same key.

Note: The tenant field is optional. You can provide env/secrets without a tenant for multi-deployment scenarios (e.g., different configurations for staging/production).

postgres-preview

When a Fly Postgres cluster has been created, you can attach the application to a postgres database automatically on deployment to the preview environment.

Provide the name of the postgres application. Fly will provide DATABASE_URL as a secret to the application to be able to connect to the database.

Before the application gets destroyed, the Postgres cluster will detach the application from the database.

Read more about attach or detach a Fly app.

secrets

Global secrets passed to all deployed applications as Fly secrets. These are merged with deployment-specific secrets from app-details (deployment-specific takes precedence).

Provide the secrets as multiline key/value strings.

- uses: ./packages/nx-fly-deployment-action
  with:
    secrets: |
      SECRET_KEY1=secret-value1
      SECRET_KEY2=secret-value2

[!NOTE] The same pattern also applies to env input.

Outputs

See action.yaml for descriptions of the outputs.