GitHub Extension
GitHub Extension
gh pvdify - Deploy directly from GitHub CLI.
Status: ⏳ Planned - Not Yet Implemented
The
gh pvdifyextension 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
# Install extensiongh extension install pvdify/gh-pvdify
# Verify installationgh pvdify --versionAuthentication
The extension uses your existing gh authentication plus a Pvdify token:
# Set Pvdify tokengh pvdify auth login
# Or use environment variableexport PVDIFY_TOKEN=your_tokenCommands
deploy
Deploy current branch to Pvdify.
gh pvdify deploygh pvdify deploy --image ghcr.io/org/app:v1.2.3gh pvdify deploy --app myapp-stagingOptions:
| Flag | Description |
|---|---|
--app | Target app (auto-detected from repo) |
--image | Container image (default: latest from GHCR) |
--wait | Wait 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.
gh pvdify statusgh pvdify status --app myappOutput:
=== myapp (production)Status: runningRelease: v42Image: ghcr.io/org/app:abc123Deployed: 5 minutes ago
Processes: web.1: running (2m uptime) web.2: running (2m uptime) worker.1: running (2m uptime)logs
View deployment logs.
gh pvdify logsgh pvdify logs -fgh pvdify logs --app myapp-stagingOptions:
| Flag | Description |
|---|---|
-f, --follow | Stream new logs |
-n, --lines | Number of lines |
--app | Target app |
preview
Create or update PR preview environment.
gh pvdify previewgh pvdify preview --pr 123When run in a PR context (CI or locally on PR branch):
- Builds image tagged with PR number
- Creates/updates preview slot
- Comments preview URL on PR
Options:
| Flag | Description |
|---|---|
--pr | PR number (auto-detected) |
--image | Custom image for preview |
preview:delete
Delete a PR preview.
gh pvdify preview:delete --pr 123rollback
Rollback to previous release.
gh pvdify rollbackgh pvdify rollback --version 41config
View/set config vars.
gh pvdify configgh pvdify config:set KEY=valuegh pvdify config:unset KEYauth
Manage authentication.
gh pvdify auth logingh pvdify auth statusgh pvdify auth logoutGitHub Actions Integration
Basic Deploy
name: Deployon: 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: Previewon: 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 Previewon: 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
| Variable | Description |
|---|---|
PVDIFY_TOKEN | Authentication token |
PVDIFY_APP | Default app name |
GH_TOKEN | GitHub token (for PR comments) |
Auto-detection Rules
The extension automatically detects:
| Context | Detection |
|---|---|
| App name | Repository name |
| Environment | Branch name → environment mapping |
| Image | ghcr.io/{owner}/{repo}:{sha} |
| PR number | GitHub event context |
Branch → Environment Mapping:
| Branch | Environment |
|---|---|
main, master | production |
develop, dev | staging |
pr-*, preview-* | preview |