Publishing Guide
Step-by-step guide to publish postgis to npm and deploy the docs to GitHub Pages.
1. Create a GitHub Repository
- Go to github.com/new
- Name it
postgis, add a description, choose Public - Do not initialize with README (you already have one)
2. Push Your Project
bash
git init
git add .
git commit -m "chore: initial commit"
git remote add origin https://github.com/jsuyog2/postgis.git
git branch -M main
git push -u origin main3. Configure CI Secrets
In your GitHub repo → Settings → Secrets and variables → Actions:
| Secret | Value |
|---|---|
NPM_TOKEN | Your npm access token (npm token create) |
CODECOV_TOKEN | From codecov.io |
4. Enable GitHub Pages
- Go to Settings → Pages
- Source: Deploy from a branch
- Branch:
gh-pages// (root) - The
docs.ymlworkflow will create thegh-pagesbranch on first push tomain
5. Publish to npm
On the first publish, run:
bash
npm login
npm publish --access publicFor subsequent releases, create a GitHub Release — the publish.yml workflow handles everything automatically.
6. Create a Release
- Bump version:
npm version patch|minor|major - Update
CHANGELOG.md— move[Unreleased]items under the new version - Push:
git push && git push --tags - Create a GitHub Release at github.com/jsuyog2/postgis/releases/new
- The CI/CD pipeline publishes automatically
7. Add Repository Badges
Add these to the top of README.md:
markdown
[](https://www.npmjs.com/package/postgis)
[](https://www.npmjs.com/package/postgis)
[](https://github.com/jsuyog2/postgis/actions/workflows/ci.yml)
[](https://codecov.io/gh/jsuyog2/postgis)
[](https://opensource.org/licenses/MIT)8. Add GitHub Topics
In your repo → About (gear icon) → Add topics:
postgis, postgresql, geospatial, nodejs, gis, geojson, mvt, typescript, spatial