Deploys a repository folder (or file) to Puter FS, then ensures a Puter subdomain points at that folder.
This action is bundled into dist/index.cjs and ships with:
@heyputer/puter.js@actions/core
Runtime: GitHub Actions node24.
subdomain(required): Subdomain to manage, such asmy-siteormy-site.puter.siteputer_path(required): Destination directory in Puter FS (for example~/sites/my-site)puter_token(required): Puter auth token, usually fromsecretssource_path(optional, default.): Repo-relative file/folder to deployinclude_hidden(optional, defaultfalse): Include dotfiles/directoriesconcurrency(optional, default8): Number of concurrent uploads
deployed_files: Number of uploaded filesdeployment_url: URL in the formhttps://<subdomain>.puter.sitebinding_action:created,updated, orunchanged
- Initializes Puter SDK from the bundled runtime (
@heyputer/puter.js/dist/puter.cjs) and sets your auth token. - Ensures
puter_pathexists as a directory. - Uploads files from
source_pathusing upsert behavior (puter.fs.write(..., { overwrite: true, createMissingParents: true })). - Reads subdomain mapping with
puter.hosting.get(subdomain). - Creates subdomain if missing, or updates it if bound to a different directory.
name: Deploy To Puter
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy website
id: puter_deploy
uses: your-org/puter-subdomain-deploy-action@v1
with:
subdomain: my-site
source_path: dist
puter_path: ~/sites/my-site
puter_token: ${{ secrets.PUTER_TOKEN }}
- name: Print URL
run: echo "Site is live at ${{ steps.puter_deploy.outputs.deployment_url }}"npm install
npm run check
npm run buildCommit dist/index.cjs after building. GitHub Actions executes that committed bundle directly.
- Push this repo to GitHub (public if you want broad reuse).
- Create and push a release tag:
git add .
git commit -m "Release v1.0.0"
git tag v1.0.0
git push origin main --tags- Create a moving major tag so users can stay on
v1:
git tag -f v1 v1.0.0
git push origin -f v1- In consumer repos, use:
uses: your-org/puter-subdomain-deploy-action@v1When you change src/deploy.mjs, rebuild before tagging:
npm run build:clean
git add src/deploy.mjs dist/index.cjs
git commit -m "Rebuild action bundle"- Open this repository on GitHub.
- Create a release from your tag (for example
v1.0.0). - On the release page, choose to publish the action to Marketplace and complete the listing form.