Sitelet https://github.com/marketplace/actions/deploy-to-harvis-dev
Skip to content

Deploy to harvis.dev

Actions

About

Upload a folder of static files (your build output or a downloaded artifact) to harvis.dev using the harvis npm package
v1
Latest
Star (0)

Deploy to harvis.dev — GitHub Action

Upload a folder of static files — your build output or a downloaded workflow artifact — to harvis.dev from GitHub Actions, using the harvis npm package.

Quick start

Deploy the build output straight from the job that built it:

name: Deploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci && npm run build
      - name: Deploy to harvis.dev
        uses: harvis-io/static-deploy-action@v1
        with:
          directory: dist
          token: ${{ secrets.HARVIS_DEPLOY_TOKEN }}

The deploy token is all you need: it identifies the site by itself, so every run updates the same one. Get it from the site's page in the harvis.dev dashboard and store it as a repository secret.

Omit token to get a fresh, anonymous site on every run — handy for pull request previews. Unclaimed sites expire 24 hours after the last deploy; the single-use claim link is exposed as the claim-url output (and kept out of the log, since whoever opens it owns the site).

Deploying uploaded artifacts

When build and deploy are separate jobs, pass the output between them with actions/upload-artifact / actions/download-artifact, then point this action at the downloaded folder:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci && npm run build
      - uses: actions/upload-artifact@v4
        with:
          name: site
          path: dist

  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: site
          path: site
      - name: Deploy to harvis.dev
        id: deploy
        uses: harvis-io/static-deploy-action@v1
        with:
          directory: site
          token: ${{ secrets.HARVIS_DEPLOY_TOKEN }}
      - run: echo "Deployed to ${{ steps.deploy.outputs.url }}"

A full copy-paste version lives in examples/build-and-deploy.yml.

Inputs

Input Required Default Description
directory no . Folder to upload (build output or downloaded artifact).
token no — Deploy token of the site to update, from the dashboard. Store it in a secret. Omit for a fresh site per run.
name no page <title> Site name shown in the dashboard.
cli-version no latest Version of the harvis npm package to run (0.0.6 or newer).

Outputs

Output Description
url Public URL of the deployed site.
subdomain Subdomain of the deployed site.
claim-url Single-use claim link, set while the site is still unclaimed (empty once claimed). Treat it like a secret.

Notes

  • Limits: 500 files, 50 MB per site. Hidden files (anything starting with .), node_modules, and OS junk files are skipped automatically.
  • The runner needs Node.js 18+ on PATH (all GitHub-hosted runners have it; on self-hosted runners add actions/setup-node first).
  • Pinning cli-version below 0.0.6 breaks updates: those versions cannot resolve a site from the token alone and will create a new site on every run instead.
  • The CLI records the site it deployed to in a harvis.json file at the project root (the site name only, no secrets). On a checked-out repository that leaves an untracked — or, if you commit harvis.json and the token names a different site, a modified — file in the workspace. Worth knowing if a later step is sensitive to a dirty working tree.
  • token wins over a committed harvis.json: the action deploys to the site the token names, whichever site the file points at.
  • On public repositories, workflow logs and PR comments are public — don't print claim-url or the deploy token anywhere.
  • If a linked unclaimed site has expired, the CLI says so and creates a new site; check the url output rather than assuming the subdomain stayed the same.

Deploy to harvis.dev is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Upload a folder of static files (your build output or a downloaded artifact) to harvis.dev using the harvis npm package
v1
Latest

Deploy to harvis.dev is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.