openporter
v1.1.3
Published
CLI tool to deploy static websites to GitHub Pages using GitHub Actions
Maintainers
Readme
OpenPorter CLI
CLI tool to deploy static websites to GitHub Pages using GitHub Actions.
Installation
# Using npm
npm install -g openporter
# Using yarn
yarn global add openporter
# Using pnpm
pnpm add -g openporterQuick Start
# Initialize OpenPorter in your project
openporter init
# Deploy to GitHub Pages
openporter deploy
# Detect framework
openporter detect
# View configuration
openporter configCommands
openporter init
Initialize OpenPorter in your project by generating a GitHub Actions workflow.
openporter init [options]Options:
-y, --yes- Skip prompts and use defaults
Example:
openporter init
# or
openporter init -yThis will:
- Detect your framework automatically
- Create
.github/workflows/openporter-deploy.yml - Create
.openporter.jsonconfiguration file
openporter deploy
Deploy your project to GitHub Pages.
openporter deploy [options]Options:
-m, --message <message>- Commit message (default: "Deploy to GitHub Pages")--no-build- Skip build step
Example:
openporter deploy
openporter deploy -m "Deploy new features"
openporter deploy --no-buildopenporter detect
Detect the framework used in your project.
openporter detectExample output:
🔍 Detecting framework...
✓ Framework detected!
📋 Detection Results:
Framework: React + Vite
Confidence: 95.0%
Build Command: npm run build
Output Directory: dist
Package Manager: npm
Node Version: 20.xopenporter config
View or update OpenPorter configuration.
# View configuration
openporter config
# Set configuration value
openporter config -s key=valueExample:
openporter config
openporter config -s branch=main
openporter config -s nodeVersion=20Configuration
OpenPorter uses .openporter.json in your project root:
{
"repo": "username/repo",
"branch": "main",
"framework": "react",
"nodeVersion": "20",
"packageManager": "npm"
}Supported Frameworks
- React + Vite
- Vue + Vite
- Svelte + Vite
- Astro
- Next.js Static Export
- Nuxt Static
- Angular
- Hugo
- Jekyll
- Docusaurus
- MkDocs
- HTML/CSS/JS
How It Works
- Initialize: Run
openporter initto generate GitHub Actions workflow - Commit: Push the workflow file to your repository
- Enable GitHub Pages: Go to repository Settings → Pages → Select "GitHub Actions"
- Deploy: Run
openporter deployor just push to your branch - Automatic Deployments: Every push triggers a new deployment
GitHub Actions Workflow
The generated workflow:
- Triggers on push to your configured branch
- Sets up Node.js with your specified version
- Installs dependencies using your package manager
- Builds your project
- Deploys to GitHub Pages
Requirements
- Node.js >= 18.0.0
- Git
- GitHub account
- Repository with GitHub Pages enabled
Publishing to npm
Prerequisites
- Create an npm account at https://www.npmjs.com/
- Login to npm:
npm login
Publishing
# Build the CLI
cd packages/cli
npm run build
# Publish to npm
npm publishPyPI Publishing
For PyPI, you'll need to create a Python wrapper or use a tool like pypa/build. This is optional and can be done separately.
Development
# Clone the repository
git clone https://github.com/LegedsDaD/openporter.git
cd openporter
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run CLI in development mode
cd packages/cli
pnpm dev
# Or link globally for testing
pnpm linkLicense
MIT License - see LICENSE file for details.
Support
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
