Courseiva
DeploymenthardMultiple ChoiceObjective-mapped

CV0-004 Deployment Practice Question

A company uses GitHub Actions to build and deploy a microservices application. They want to automate the deployment to a Kubernetes cluster only when changes are pushed to the main branch. Which GitHub Actions event trigger should be used in the workflow?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

on: push: branches: [ main ]

The 'push' event with branch filters triggers on pushes to main. 'pull_request' triggers on PR events; 'schedule' triggers on a cron; 'workflow_dispatch' triggers manually.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • on: workflow_dispatch:

    Why it's wrong here

    Manual trigger only.

  • on: push: branches: [ main ]

    Why this is correct

    Correct. Runs workflow on push to main branch.

  • on: schedule: - cron: '0 0 * * *'

    Why it's wrong here

    Scheduled trigger, not event-driven.

  • on: pull_request: branches: [ main ]

    Why it's wrong here

    Triggers on pull request events, not pushes.

About these practice questions

Courseiva writes every CV0-004 question from scratch — 977 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CV0-004 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CV0-004 exam.