Bird
0
0

Which of the following is the correct syntax to define a job named deploy in a GitHub Actions workflow YAML file?

easy📝 Syntax Q3 of 15
Django - Deployment and Production
Which of the following is the correct syntax to define a job named deploy in a GitHub Actions workflow YAML file?
Ajob deploy { runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 }
Bdef deploy(): runs-on = 'ubuntu-latest' steps = ['actions/checkout@v3']
Cdeploy = { runs-on: ubuntu-latest, steps: [uses: actions/checkout@v3] }
Ddeploy:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3
Step-by-Step Solution
Solution:
  1. Step 1: Understand GitHub Actions YAML job syntax

    Jobs are defined as keys with nested properties like runs-on and steps in YAML format.
  2. Step 2: Compare options to correct YAML syntax

    deploy:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v3 uses correct YAML indentation and keys; others use invalid syntax or programming language style.
  3. Final Answer:

    YAML job definition with runs-on and steps keys -> Option D
  4. Quick Check:

    GitHub Actions job syntax = YAML with runs-on and steps [OK]
Quick Trick: GitHub Actions jobs use YAML with runs-on and steps keys [OK]
Common Mistakes:
MISTAKES
  • Using programming language syntax instead of YAML
  • Incorrect indentation or missing colons in YAML

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes