Guides
GitHub Actions
There is no action to install. The CLI runs under npx, so a deploy is one step in a
workflow, and pinning the version is the only setup worth doing:
Code
Four things about that are deliberate:
--siteis named, not left todrop2run.json. Both work, and either is better than neither: with no site at all every run creates a new one, so a workflow on every push would leave a trail of sites and a URL nobody is looking at. Committingdrop2run.jsonand dropping--siteis the same decision made in the repository instead of the workflow.- The version is pinned.
npx drop2runwithout one takes whatever is latest at the moment the job runs, which is a deploy step that can change under you between two identical commits. - The token is a secret, and the only one needed. Create it at
Account → Access tokens — neither
loginflow works in CI, since nothing there can open a browser or approve a code. Authentication has the steps. - The URL comes out of
--json, not out of the log. Parsing the human line would break the first time it was reworded; the JSON is the contract.
unchanged: true in that file means the commit changed nothing the site serves, so no version was
published. Worth branching on if the workflow announces deploys somewhere: it is a success, and
announcing it as a new deploy would be wrong.
Other CI systems
Nothing above is specific to GitHub beyond $GITHUB_OUTPUT and the uses: steps. Anywhere that can run
Node and hold a secret works the same way: set DROP2RUN_TOKEN, run `npx --yes drop2run@
Last modified on