If your content already lives in a Git repository, the simplest publishing button is the merge button. This guide sets up GitHub Actions to publish a folder of Markdown with the Sentilis CLI every time main changes.
What you need
- A repository with your content folder — for example
content/, containingpress/,bio/or any other Sentilis folder. - Your Sentilis profile token.
1. Store the token as a secret
In the repository settings, add a secret named SENTILIS_TOKEN with your profile token. Never commit the token to the repository.
2. Add the workflow
Create .github/workflows/publish.yml:
name: Publish content to Sentilis
on:
push:
branches: [main]
paths:
- "content/**"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install the Sentilis CLI
run: npm i -g @sentilis/cli
- name: Authenticate
run: sentilis auth login ${{ secrets.SENTILIS_TOKEN }}
- name: Publish
run: sentilis sync ./content --strict
What each part does:
pathsruns the workflow only when content changes.workflow_dispatchadds a button to run it by hand.--strictaborts the run if any entry has a validation problem, so nothing is half-published and the job fails visibly.
3. Validate pull requests
Add a second job, or a second workflow on pull_request, that runs the same steps with --dry-run instead of --strict. It validates every entry without uploading anything, so problems show up in review:
- name: Validate
run: sentilis sync ./content --dry-run
Several profiles
The CLI can hold several profiles. If one repository publishes to more than one profile — one per language, for example — run one job per folder, each with its own token secret.
Troubleshooting
- The job fails on a validation error: that is
--strictdoing its job. Fix the file named in the log and push again. - Nothing changes on the site: check that the pushed files are inside the folder you sync, and that their
statusispublished.