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

cpanel-deploy

v1.1.0

Published

Set up GitHub Actions deploys to cPanel in one command, with database migrations, SQL updates, backups and database tools. No SSH needed.

Readme

cpanel-deploy

Set up GitHub Actions deploys to cPanel in one command. Migrations, SQL updates, backups and database tools included. No SSH needed.

No more copying the same workflow file into every repo and typing CPANEL_HOST, CPANEL_USERNAME and CPANEL_PASSWORD into GitHub by hand.

npx cpanel-deploy

Website: https://saikat.polapain.net/cpanel-deploy

What it does

Run it inside your project folder and answer a few questions:

  1. Pick a cPanel account you saved before, or add one. The FTP login is tested right away.
  2. Pick the branch that should deploy (a manual "Run workflow" button is added too).
  3. Browse the server folders over FTP and choose where files go, like public_html/live/.
  4. Confirm build steps. If it finds composer.json it offers composer install, if package.json has a build script it offers npm run build.
  5. Database steps (optional). For Laravel or other PHP projects it can run migrations and SQL updates after every deploy, with a backup first.
  6. Done. It writes .github/workflows/cpanel-deploy.yml, uploads the secrets to GitHub and commits the files. Push and it ships.

Commands

| Command | What it does | | --- | --- | | npx cpanel-deploy | Interactive menu | | npx cpanel-deploy init | Set up deploys for the current repo. Run again to add another target, like staging. | | npx cpanel-deploy profiles | Add, edit, test or delete saved cPanel accounts | | npx cpanel-deploy db | Create a database, upload or download one, run SQL, back up, bring the site back up | | npx cpanel-deploy secrets | Upload the secrets again (changed password, new host) | | npx cpanel-deploy doctor | Check Node, Git, GitHub CLI and the current repo |

Requirements

  • Node.js 20.12 or newer
  • Git
  • One of these, so secrets can be uploaded for you:

Without either, the tool still writes the workflow and tells you which secrets to add.

Database steps on every deploy

Turn them on during init. After the files upload, GitHub calls a small signed PHP file on your server that:

  1. checks what's pending: Laravel migrations, and new .sql files in database/updates/
  2. if nothing is pending, only clears config, route and view caches (no downtime, no backup)
  3. otherwise puts the app in maintenance mode (Laravel), backs up the database, runs the new SQL files once each, runs php artisan migrate --force, clears caches and brings the app back up

If something fails, the GitHub run turns red and the site stays in maintenance mode (or comes back up, you choose during setup). Backups are kept in storage/app/cpanel-deploy-backups/ (last 5).

Small one off changes: drop a file like database/updates/2026_10_27_01_fix_prices.sql in your repo. It runs once, in name order, on the next deploy and is remembered in the cpanel_deploy_updates table. Works for plain PHP projects too (database settings are read from the .env next to the project).

How the hook stays safe: the file name is random, the secret is only in GitHub secrets (never in git), every request is signed with HMAC SHA-256 and expires after 5 minutes. Anything else gets a plain 404. It runs Artisan inside PHP, so it works on hosts that disable exec.

Database tools

npx cpanel-deploy db
  • Create a database: database, user and a strong password in one go, and optionally written straight into the server .env
  • Upload a database: from a .sql/.sql.gz file or straight from your local MySQL (XAMPP, Laragon). The server database is backed up first
  • Download a database: to a .sql.gz file, optionally imported into your local MySQL
  • Run SQL: quick queries on the live database. Anything that isn't a read asks for confirmation first
  • Back up now / bring the site back up: when database steps are enabled

How it reaches the database without SSH: with a cPanel API token (cPanel > Security > Manage API Tokens), it allows only your current IP in Remote MySQL, creates a short lived MySQL user for that one database, and removes both when done, even if the session crashes (the next session cleans up). If your host blocks Remote MySQL, it works through the deploy hook instead, on the project's own database.

Data is copied exactly: dates without timezone shifts, big integers and decimals as exact text, JSON as stored, binary columns, emoji. Views and triggers are made portable so they keep working after import.

Multiple targets

Run init again in the same repo and choose "Add another deploy target". A target named staging gets its own file cpanel-deploy-staging.yml and its own secrets CPANEL_STAGING_HOST, CPANEL_STAGING_USERNAME, CPANEL_STAGING_PASSWORD, so live and staging never mix.

Security notes

  • Saved accounts live in ~/.cpanel-deploy/config.json on your computer, with permissions limited to your user. You can choose not to save a password and type it each time.
  • Prefer a dedicated FTP account in cPanel limited to the deploy folder, instead of your main cPanel login.
  • Choose FTPS (the default). Plain FTP sends the password unencrypted.
  • Shared hosts often present a certificate for the server hostname, not your domain. The tool detects this and can set security: loose for that account. Using the server hostname from cPanel as the FTP host avoids it.

Generated workflow

Uses SamKirkland/FTP-Deploy-Action, which only uploads files that changed since the last deploy. Example:

name: Deploy to cPanel
on:
  push:
    branches:
      - 'cp-live'
  workflow_dispatch:
concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: false
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - name: Deploy via FTP
        uses: SamKirkland/[email protected]
        with:
          server: ${{ secrets.CPANEL_HOST }}
          username: ${{ secrets.CPANEL_USERNAME }}
          password: ${{ secrets.CPANEL_PASSWORD }}
          protocol: ftps
          local-dir: './'
          server-dir: 'public_html/live/'

Development

npm install
npm test
node bin/cpanel-deploy.js

Environment variables useful while testing:

  • CPANEL_DEPLOY_HOME changes where accounts are saved
  • CPANEL_DEPLOY_GITHUB_API points the GitHub API calls at a mock server

License

MIT © Moniruzzaman Saikat