Skill: kryzl19/git-deployer (version 1.0.0)

--- name: git-deployer description: Push static site content to GitHub Pages repositories. Clone, copy files, commit with timestamp, force-push. Use when updating GitHub Pages sites, deploying static sites, or syncing local content to a git-based host. --- # git-deployer Deploy static site content to GitHub Pages or any git-backed host. ## When to Use - **GitHub Pages updates** — You have a local build/output directory and want to push it to a `username.github.io` repo or a Pages branch (`gh-pages`, `main`) - **Static site deployment** — Hugo, Jekyll, Gatsby, Docusaurus, or any static site with a git-hosted output - **Automated CI replacement** — Instead of setting up GitHub Actions, you want a one-command deploy from your machine - **Syncing local → remote** — You edit content locally and need to push changes to a hosted git repository ## Workflow ``` Local Site Directory → /tmp/clone → File Copy → Commit → Force Push → Done ``` 1. **Clone or init** — If the remote repo exists, clone it to `/tmp/{reponame}`. Otherwise initialize a fresh clone 2. **Copy files** — Sync your local site directory contents into the clone (clean copy, not append) 3. **Commit** — Stage all files, commit with auto-generated timestamp message 4. **Force push** — Push to remote with force flag to overwrite remote state 5. **Report** — Output success/failure with commit hash and push result ## Usage ### Via skill invocation (from agent) Provide the following arguments: - `site_path` — Absolute path to the local site directory (the content to deploy) - `remote_url` — Full git URL (e.g., `https://github.com/user/repo.git` or `[REDACTED_SECRET]:user/repo.git`) - `branch` — Branch to deploy to (default: `main`) ### Via script directly ```bash ./scripts/deploy.sh /path/to/site [REDACTED_SECRET]:user/repo.git [branch] ``` ## Output - **Success** — Shows commit hash, remote URL, branch, and push status - **Failure** — Shows error message with exit code and which step failed ## Requirements - `git` must be installed and configured with credentials for the remote - SSH key or HTTPS token auth must be set up for the remote repository - Site path must exist and contain files ## Notes - Uses `--force` push — this will overwrite remote state. Use with caution on shared branches - Clone happens in `/tmp` and is not cleaned up automatically (intentional: allows inspection) - Commit message format: `Deploy: YYYY-MM-DD HH:MM:SS UTC`

path: scripts/deploy.sh
content: #!/bin/bash
# git-deployer — Deploy static site content to a git remote
# Usage: deploy.sh <site_path> <remote_url> [branch]
# Example: deploy.sh /home/tim/site-build [REDACTED_SECRET]:user/repo.git main

set -e

SITE_PATH="$1"
REMOTE_URL="$2"
BRANCH="${3:-main}"

if [[ -z "$SITE_PATH" || -z "$REMOTE_URL" ]]; then
    echo "ERROR: Missing required arguments"
    echo "Usage: deploy.sh <site_path> <remote_url> [branch]"
    exit 1
fi

if [[ ! -d "$SITE_PATH" ]]; then
    echo "ERROR: Site path does not exist or is not a directory: $SITE_PATH"
    exit 1
fi

# Extract repo name from URL for /tmp directory
REPO_NAME=$(basename "$REMOTE_URL" .git)
TMP_CLONE="/tmp/$REPO_NAME"
TIMESTAMP=$(date -u "+%Y-%m-%d %H:%M:%S")
COMMIT_MSG="Deploy: $TIMESTAMP UTC"

echo "=== git-deployer ==="
echo "Site path: $SITE_PATH"
echo "Remote:    $REMOTE_URL"
echo "Branch:    $BRANCH"
echo "Timestamp: $TIMESTAMP"
echo ""

# Clone or init
if [[ -d "$TMP_CLONE" ]]; then
    echo "[1/5] Clone exists at $TMP_CLONE — pulling latest..."
    cd "$TMP_CLONE"
    git fetch origin
    git checkout "$BRANCH" || git checkout -b "$BRANCH"
    git pull origin "$BRANCH"
else
    echo "[1/5] Cloning fresh repo..."
    git clone "$REMOTE_URL" "$TMP_CLONE"
    cd "$TMP_CLONE"
    git checkout "$BRANCH" 2>/dev/null || git checkout -b "$BRANCH"
fi

# Copy files (rsync-like behavior: mirror contents)
echo "[2/5] Copying site files to clone..."
rsync -av --delete "$SITE_PATH/" "$TMP_CLONE/"

# Stage all changes
echo "[3/5] Staging files..."
git add -A

# Check if there are changes to commit
if git diff --staged --quiet; then
    echo "No changes to commit — repository is up to date."
    echo "Nothing to push."
    exit 0
fi

# Commit
echo "[4/5] Committing..."
git commit -m "$COMMIT_MSG"
COMMIT_HASH=$(git rev-parse HEAD)
echo "Committed: $COMMIT_HASH"

# Force push
echo "[5/5] Force-pushing to $BRANCH..."
git push -u origin "$BRANCH" --force

echo ""
echo "=== Deploy Complete ==="
echo "Commit:    $COMMIT_HASH"
echo "Remote:    $REMOTE_URL"
echo "Branch:    $BRANCH"
echo "Clone:     $TMP_CLONE"


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)