Hi @talisman,
You need to use stages with conditional logic and avoid placing deploy: at the root of .travis.yml. Instead, define deploy as a job inside the jobs.include section with a stage: deploy label and use if: to control it.
For example:
stages:
- test
- name: deploy
if: branch = main AND type != pull_request
jobs:
include:
- python: "3.8"
stage: test
script: pytest
- python: "3.9"
stage: test
script: pytest
- python: "3.10"
stage: test
script: pytest
- stage: deploy
if: branch = main AND type != pull_request AND python = "3.10"
script: ./scripts/deploy.sh
Skip deploy if secrets are not set early on in the build:
[ -z "$MY_SECRET_TOKEN" ] && echo "No secret available, skipping deploy." && exit 0
This should handle it, this is a bit more complex case you’re correct. This should get your build working again though.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Continuous Integration, Deployment, and Build Failures for a Restaurant Menu Website Using Travis CI | 0 | 7 | 09-02-2026 |
| 2 | Failing after success stage | 5 | 7 | 14-10-2025 |
| 3 | Travis CI Pipeline Reliability Issues While Building, Testing, and Deploying My Real-Time Morse Code Website | 0 | 7 | 20-06-2026 |
| 4 | Travis CI build failing after dependency updates for my website project | 0 | 7 | 06-11-2025 |
| 5 | TRAVIS_COMMIT and TRAVIS_PULL_REQUEST_SHA commit SHA's getting masked in web log output | 0 | 6 | 04-12-2025 |
| 6 | Multi-Service Docker Compose Build in Travis CI with Cross-Container Caching and Service Health Checks | 0 | 7 | 03-06-2025 |
| 7 | Deployment instructions skipped due to DPL compatibility issues | 0 | 5 | 14-10-2025 |
| 8 | How to get travis-ci support? | -8 | 6 | 02-06-2026 |
| 9 | Travis Displays intermittent "We couldn't display the repository" | 0 | 5 | 19-01-2026 |