Skip to content

shipstatic/action-example

Repository files navigation

shipstatic/action-example

Deploy

Example workflows for the ShipStatic GitHub Action — a React + Vite app deployed to action-example.shipstatic.com.

deploy-no-account.yml — Free, No Account Needed

Push to main deploys instantly. No API key, no sign-up, no configuration — expires in 3 days.

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

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      - uses: shipstatic/action@v1
        with:
          path: ./dist

deploy-api-key.yml — Free API Key

Push to main deploys permanently. Get a free API key at my.shipstatic.com/api-key and add it as a SHIP_API_KEY secret.

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

permissions:
  contents: read
  deployments: write

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      - uses: shipstatic/action@v1
        with:
          api-key: ${{ secrets.SHIP_API_KEY }}
          path: ./dist
          github-token: ${{ secrets.GITHUB_TOKEN }}

deploy-domain.yml — Free API Key + Custom Domain

Push to main deploys permanently and links a custom domain. Set a DOMAIN variable with your domain name (Settings > Variables > Actions).

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

permissions:
  contents: read
  deployments: write

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      - id: deploy
        uses: shipstatic/action@v1
        with:
          api-key: ${{ secrets.SHIP_API_KEY }}
          path: ./dist
          domain: ${{ vars.DOMAIN }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - run: echo "Deployed to ${{ steps.deploy.outputs.url }}" >> "$GITHUB_STEP_SUMMARY"

preview-pr.yml — PR Preview

Every pull request gets a preview deploy with the URL posted as a comment. Works without an API key — expires in 3 days.

name: Preview
on: pull_request

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

jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      - uses: shipstatic/action@v1
        with:
          path: ./dist
          github-token: ${{ secrets.GITHUB_TOKEN }}

See the action documentation for all inputs, outputs, and options.

About

Example: deploy a React app to ShipStatic with GitHub Actions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors