Guides
CI/CD Integration
Integrate CliFi into your continuous integration and delivery pipelines with GitHub Actions, GitLab CI, and CircleCI.
GitHub Actions
CliFi provides a first-party GitHub Action that installs the CLI and caches dependencies between runs. Use it in your workflow to run builds, tests, and deployments.
.github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: clifi/action@v2
with:
version: "2.4.1"
- run: clifi run --env productionGitLab CI
For GitLab, use the Docker image or install CliFi in a before_script:
.gitlab-ci.yml
deploy:
image: node:20
before_script:
- npm install -g clifi
script:
- clifi run --env production
only:
- mainCircleCI
CircleCI orb support is available through the community-maintained orb. Add it to your .circleci/config.yml:
.circleci/config.yml
version: 2.1
orbs:
clifi: clifi/executor@1.0
workflows:
deploy:
jobs:
- clifi/run:
env: production
filters:
branches:
only: mainBest practices
- Pin the CliFi version in CI to ensure reproducible builds
- Use
--dry-runin pull request checks to validate workflow changes - Store environment secrets in your CI provider, not in the repository
- Cache the
.clifi/cachedirectory between runs for faster execution