Skip to content

CI and automation

Publish a theme from GitHub Actions or any CI with an environment variable.

In CI the CLI reads the key from PAYSUM_API_KEY, so there is nothing to log in to. Use a dedicated key with only the Theme code: Write and Store details: Read scopes, and pass --yes because there is nobody to answer the confirmation.

GitHub Actions #

.github/workflows/publish-theme.yml
name: Publish theme
on:
  push:
    branches: [main]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npx @paysum/cli publish --yes --force
        env:
          PAYSUM_API_KEY: ${{ secrets.PAYSUM_API_KEY }}

--force makes the repository the source of truth: it overwrites drafts that were edited in the dashboard. Leave it out if you want the job to fail instead.

Exit codes #

CodeMeaning
0Success.
1The command failed: bad key, missing scope, conflict or build error.
2Unknown command or option.