Deploy static sites to Shipstatic from GitHub Actions.
name: Deploy
on:
push:
branches: [main]
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
uses: shipstatic/action@v1
with:
api-key: ${{ secrets.SHIP_API_KEY }}
path: ./dist
domain: www.example.com
github-token: ${{ secrets.GITHUB_TOKEN }}| Input | Required | Default | Description |
|---|---|---|---|
api-key |
Yes | - | Shipstatic API key |
path |
No | . |
Directory to deploy |
domain |
No | - | Domain to link to the deployment |
github-token |
No | - | GitHub token for PR comments and deployment tracking |
The github-token input enables two features:
- PR comments - posts the deployment URL as a comment on pull requests
- GitHub Deployments - creates deployment objects visible in the repo sidebar
Use the automatic ${{ secrets.GITHUB_TOKEN }} - no extra secrets needed. Your workflow needs these permissions:
permissions:
contents: read
deployments: write
pull-requests: write| Output | Description |
|---|---|
id |
Deployment ID |
url |
Deployment URL |
See action-example for a complete working example using React + Vite.
- Get an API key from your Shipstatic dashboard
- Add it as a repository secret named
SHIP_API_KEY(Settings > Secrets and variables > Actions) - Add the workflow above to
.github/workflows/deploy.yml
MIT