ShipStatic Docs llms.txt llms-full.txt

Ship Action

A GitHub Action for deploying static sites to ShipStatic. Supports PR previews, custom domains, and GitHub Deployments. Marketplace / GIT

- uses: shipstatic/action@v1
  with:
    api-key: ${{ secrets.SHIP_API_KEY }}
    path: ./dist

Quick Start

Add to your workflow:

name: Deploy
on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read
  deployments: write
  pull-requests: write

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Build
        run: npm ci && npm run build

      - name: Deploy
        id: deploy
        uses: shipstatic/action@v1
        with:
          api-key: ${{ secrets.SHIP_API_KEY }}
          path: ./dist
          domain: ${{ github.event_name == 'push' && 'www.example.com' || '' }}
          github-token: ${{ secrets.GITHUB_TOKEN }}

Drop the api-key line for public PR previews — see Anonymous deploys below.

Authentication

Optional. Without an api-key, the action deploys publicly — the response includes a claim URL the user can visit later to keep the site permanently. With an api-key, deployments go to your account and never expire. Store the key as a repository secret and pass it via the api-key input.

Inputs

Input Required Default Description
api-key No - ShipStatic API Key for permanent deploys
path No . Directory to deploy
domain No - Custom domain to link to the deployment (requires api-key)
password No - Password-protect the deployment (6–128 characters). Visitors are prompted to unlock before viewing
github-token No - GitHub token for PR comments and deployments

Outputs

Output Description
id Deployment ID (e.g. happy-cat-abc1234)
url Deployment URL (e.g. https://happy-cat-abc1234.shipstatic.com)
claim Claim URL for public deploys — visit while signed in to keep the site permanently. Empty for authenticated deploys

Use outputs in subsequent steps:

- name: Summary
  run: echo "Deployed to ${{ steps.deploy.outputs.url }}" >> "$GITHUB_STEP_SUMMARY"

Features

Anonymous deploys

Without an api-key, the action deploys publicly. The claim output contains a URL the user can visit while signed in at my.shipstatic.com to keep the deployment permanently. Useful for open-source PR previews where contributors don't have your API key.

- name: Deploy
  id: deploy
  uses: shipstatic/action@v1
  with:
    path: ./dist

- name: Comment claim URL
  if: steps.deploy.outputs.claim != ''
  run: echo "Claim this preview at ${{ steps.deploy.outputs.claim }}" >> "$GITHUB_STEP_SUMMARY"

Public deploys expire in 3 days unless claimed.

PR Previews

When github-token is provided and the workflow runs on a pull request, the action posts the deployment URL as a PR comment.

Custom Domains

When domain is provided, the action links the deployment to that domain after upload. Useful for production deploys:

domain: ${{ github.event_name == 'push' && 'www.example.com' || '' }}

This links the domain on push to main, but skips it for PRs (preview only).

GitHub Deployments

When github-token is provided, the action creates a GitHub Deployment visible in the repository sidebar. Environment is set to "preview" for PRs and "production" for pushes to the default branch.

Permissions

The action needs these workflow permissions when using github-token:

permissions:
  contents: read
  deployments: write
  pull-requests: write

Architecture

Composite action wrapping the CLI. Installs @shipstatic/ship at runtime, runs ship commands, and parses JSON output. No custom code beyond shell scripts.