Skip to content

GitHub Extension

GitHub Extension

gh pvdify - Deploy directly from GitHub CLI.

Status: ⏳ Planned - Not Yet Implemented

The gh pvdify extension is currently in development. The commands below represent the planned interface. For now, use the REST API directly via curl in your GitHub Actions workflows.

Installation

Terminal window
# Install extension
gh extension install pvdify/gh-pvdify
# Verify installation
gh pvdify --version

Authentication

The extension uses your existing gh authentication plus a Pvdify token:

Terminal window
# Set Pvdify token
gh pvdify auth login
# Or use environment variable
export PVDIFY_TOKEN=your_token

Commands

deploy

Deploy current branch to Pvdify.

Terminal window
gh pvdify deploy
gh pvdify deploy --image ghcr.io/org/app:v1.2.3
gh pvdify deploy --app myapp-staging

Options:

FlagDescription
--appTarget app (auto-detected from repo)
--imageContainer image (default: latest from GHCR)
--waitWait for deploy to complete

Auto-detection:

  • App name inferred from repository name
  • Image inferred from GitHub Container Registry
  • Environment inferred from branch (main→production, develop→staging)

status

Check deployment status.

Terminal window
gh pvdify status
gh pvdify status --app myapp

Output:

=== myapp (production)
Status: running
Release: v42
Image: ghcr.io/org/app:abc123
Deployed: 5 minutes ago
Processes:
web.1: running (2m uptime)
web.2: running (2m uptime)
worker.1: running (2m uptime)

logs

View deployment logs.

Terminal window
gh pvdify logs
gh pvdify logs -f
gh pvdify logs --app myapp-staging

Options:

FlagDescription
-f, --followStream new logs
-n, --linesNumber of lines
--appTarget app

preview

Create or update PR preview environment.

Terminal window
gh pvdify preview
gh pvdify preview --pr 123

When run in a PR context (CI or locally on PR branch):

  1. Builds image tagged with PR number
  2. Creates/updates preview slot
  3. Comments preview URL on PR

Options:

FlagDescription
--prPR number (auto-detected)
--imageCustom image for preview

preview:delete

Delete a PR preview.

Terminal window
gh pvdify preview:delete --pr 123

rollback

Rollback to previous release.

Terminal window
gh pvdify rollback
gh pvdify rollback --version 41

config

View/set config vars.

Terminal window
gh pvdify config
gh pvdify config:set KEY=value
gh pvdify config:unset KEY

auth

Manage authentication.

Terminal window
gh pvdify auth login
gh pvdify auth status
gh pvdify auth logout

GitHub Actions Integration

Basic Deploy

name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Deploy
run: gh pvdify deploy --image ghcr.io/${{ github.repository }}:${{ github.sha }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PVDIFY_TOKEN: ${{ secrets.PVDIFY_TOKEN }}

PR Previews

name: Preview
on:
pull_request:
types: [opened, synchronize]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build preview
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:pr-${{ github.event.number }}
- name: Deploy preview
run: gh pvdify preview
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PVDIFY_TOKEN: ${{ secrets.PVDIFY_TOKEN }}

Cleanup Previews

name: Cleanup Preview
on:
pull_request:
types: [closed]
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Delete preview
run: gh pvdify preview:delete --pr ${{ github.event.number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PVDIFY_TOKEN: ${{ secrets.PVDIFY_TOKEN }}

Repository Configuration

Create .pvdify.yaml in your repository root:

app: myapp
environments:
main: production
develop: staging
preview:
enabled: true
ttl: 7d # Auto-delete after 7 days
build:
dockerfile: Dockerfile
context: .

Environment Variables

VariableDescription
PVDIFY_TOKENAuthentication token
PVDIFY_APPDefault app name
GH_TOKENGitHub token (for PR comments)

Auto-detection Rules

The extension automatically detects:

ContextDetection
App nameRepository name
EnvironmentBranch name → environment mapping
Imageghcr.io/{owner}/{repo}:{sha}
PR numberGitHub event context

Branch → Environment Mapping:

BranchEnvironment
main, masterproduction
develop, devstaging
pr-*, preview-*preview