DevOps / Github Interview questions
What is a GitHub Actions workflow file?
A workflow file is a YAML file placed under .github/workflows/ that defines when a workflow runs, what jobs it contains, and what each job does. GitHub automatically discovers and evaluates every workflow file in that directory against incoming repository events.
name: CI on: push: branches: [main] pull_request: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install dependencies run: npm install - name: Run tests run: npm test
The on key defines the trigger conditions, jobs defines one or more named jobs (here, build), runs-on selects the runner image, and steps lists the ordered actions and shell commands executed for that job.
More Related questions...