Docker and CI/CD · Middle · Question 45 of 75

How do you run a deploy step only for pushes to main?

Explanation

Expressions in if: can check the event, branch, previous results (success(), failure()) and more. only: is GitLab's older syntax.

Further reading

Problem with a question

Docker and CI/CD · Middle · question 45

Test yourself

Take the Docker and CI/CD · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz