# CircleCI Integration

Define `ESCAPE_APPLICATION_ID` (the profile ID) and `ESCAPE_API_KEY` as project environment variables. CircleCI doesn't expand environment variable references inside its YAML `environment` block.

Add the following configuration to your `.circleci/config.yml`:

```yaml
version: 2.1

jobs:
  deploy: 
    docker:
      - image: alpine/curl:8.12.1
    steps:
      - checkout
      # Your deployment steps here

  escape_scan:
    docker:
      - image: alpine/curl:8.12.1
    steps:
      - checkout
      - run:
          name: Install Escape CLI
          command: |
            apk add --no-cache bash
            curl -sf https://raw.githubusercontent.com/Escape-Technologies/cli/refs/heads/main/scripts/install.sh | bash
      - run:
          name: Run Escape Scan
          command: escape-cli scans start ${ESCAPE_APPLICATION_ID} --watch

workflows:
  version: 2
  deploy_and_scan:
    jobs:
      - deploy
      - escape_scan:
          requires:
            - deploy
          filters:
            branches:
              only: staging
```
