Deployment
GitHub Actions
GitHub Actions is a natural fit for Messagevisor because the workflow is already Git-based.
Basic validate-and-build workflow#
name: Messagevisoron: pull_request: push: branches: [main]jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - run: npm ci - run: npx messagevisor lint - run: npx messagevisor test - run: npx messagevisor build --showSizeUpload datafiles as artifacts#
- run: npx messagevisor build - uses: actions/upload-artifact@v4 with: name: datafiles path: datafiles/Or upload to your desired CDN directly.
Push back revision info#
- name: Push back to origin run: | git add .messagevisor/ if git diff --cached --quiet; then echo "No state file changes to commit" else git commit -m "[skip ci] Revision $(cat .messagevisor/REVISION)" git push fiPass the directory rather than a shell glob. git add .messagevisor/ lets Git walk the directory and skip anything your .gitignore covers, such as .messagevisor/cache. A shell glob like .messagevisor/* is expanded by the shell before Git runs, so Git receives the ignored cache directory as an explicitly named path and refuses it with a non-zero exit once that directory exists.
The guard around git commit keeps the step green when a run produces no revision change, because git commit exits non-zero when nothing is staged.
Learn more in State files.
Sets-based deployment workflow#
For projects using sets, a full staging-to-production promote and build might look like:
name: Messagevisor deployon: push: branches: [main]jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 24 - run: npm ci - run: npx messagevisor lint --set=production - run: npx messagevisor test --set=production - run: npx messagevisor build --set=production - uses: actions/upload-artifact@v4 with: name: production-datafiles path: datafiles/