Docs / Guides

Deploys and maintenance from CI

Two calls from your pipeline make incidents easier to understand and quieter during planned work:

Both need an API key: the account owner creates one under Account → API keys. Store it as a secret named PULSEFAST_API_KEY.

#GitHub Actions

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Quiet monitors while we migrate
        id: maintenance
        run: |
          id=$(curl -fsS -X POST https://pulsefast.io/api/v1/maintenance \
            -H "Authorization: Bearer ${{ secrets.PULSEFAST_API_KEY }}" \
            -d '{"title": "Deploy ${{ github.sha }}", "duration_minutes": 15}' | jq -r .id)
          echo "id=$id" >> "$GITHUB_OUTPUT"          

      - run: ./deploy.sh

      - name: Record the deploy
        run: |
          curl -fsS -X POST https://pulsefast.io/api/v1/deploys \
            -H "Authorization: Bearer ${{ secrets.PULSEFAST_API_KEY }}" \
            -d '{"service": "checkout", "version": "${{ github.sha }}", "environment": "production",
                 "url": "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"}'          

      - name: End maintenance early (also if the deploy failed)
        if: always() && steps.maintenance.outputs.id != ''
        run: |
          curl -fsS -X DELETE https://pulsefast.io/api/v1/maintenance/${{ steps.maintenance.outputs.id }} \
            -H "Authorization: Bearer ${{ secrets.PULSEFAST_API_KEY }}"          

#GitLab CI

deploy:
  stage: deploy
  script:
    - ./deploy.sh
    - >
      curl -fsS -X POST https://pulsefast.io/api/v1/deploys
      -H "Authorization: Bearer $PULSEFAST_API_KEY"
      -d "{\"service\": \"checkout\", \"version\": \"$CI_COMMIT_SHA\", \"environment\": \"$CI_ENVIRONMENT_NAME\"}"      

#Any pipeline

curl -fsS -X POST https://pulsefast.io/api/v1/deploys \
  -H "Authorization: Bearer $PULSEFAST_API_KEY" \
  -d '{"version": "'"$GIT_SHA"'"}'

#Tips

All fields: Deploy markers and Maintenance windows.

View as Markdown · Something unclear? Tell us