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 }}
Authentication
Requires an API Key passed via the api-key input. Store it as a repository secret.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
api-key |
Yes | - | ShipStatic API Key |
path |
No | . |
Directory to deploy |
domain |
No | - | Custom domain to link to the deployment |
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.dev) |
Use outputs in subsequent steps:
- name: Summary
run: echo "Deployed to ${{ steps.deploy.outputs.url }}" >> "$GITHUB_STEP_SUMMARY"
Features
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.