Prev Next

DevOps / Github Interview questions

Explain the execution flow of a GitHub Actions workflow from push to deployment?

When a developer pushes a commit, GitHub evaluates every workflow file under .github/workflows/ against the event, and any workflow whose on conditions match gets triggered as a new run.

sequenceDiagram participant Dev as Developer participant GH as GitHub participant Runner as Actions Runner participant Reg as GitHub Packages participant Env as Deploy Target Dev->>GH: git push (commit) GH->>GH: Match event against workflow triggers GH->>Runner: Provision runner, assign build job Runner->>Runner: Checkout code, run steps Runner->>Reg: Publish built package/image Runner-->>GH: Report job status GH->>Runner: Assign test job (parallel or dependent) Runner-->>GH: Report test results GH->>Runner: Assign deploy job (needs: build, test) Runner->>Env: Deploy artifact Runner-->>GH: Report deployment status GH-->>Dev: Update checks on commit/PR

Within a workflow, jobs run in parallel by default unless a needs relationship forces one job to wait for another, such as a deploy job that needs both build and test to succeed first. Artifacts produced by an early job (a compiled binary, a built image reference) can be uploaded and downloaded by a later job so work isn't repeated. The final result, success or failure, is reported back as a status check on the commit and any associated pull request, which is what required status checks use to gate merging.

What determines whether a workflow is triggered by a push event?
A deploy job that lists needs: [build, test] will:

More Related questions...

What is GitHub? What is a GitHub repository? What is the difference between Git and GitHub? What is the difference between GitHub and GitLab? What are the main features of GitHub? What is a GitHub pull request? What is GitHub Actions? What is a GitHub Actions workflow file? What is a GitHub Actions runner? What are jobs and steps in a GitHub Actions workflow? What is GitHub Issues? What are GitHub Projects (boards)? What is a GitHub organization? What is GitHub Packages? What is GitHub Pages? What are branch protection rules in GitHub? What is GitHub Copilot? What is forking in GitHub? What are GitHub labels? What is the GitHub Wiki? What are the different GitHub plans? What is a GitHub Gist? What is GitHub Codespaces? What is a GitHub template repository? What are GitHub releases and tags? Explain the execution flow of a GitHub Actions workflow from push to deployment? Why would a team choose GitHub over GitLab for an open-source project? How does a GitHub pull request differ from a GitLab merge request? What is the difference between GitHub.com and GitHub Enterprise Server? How do you write a multi-job GitHub Actions workflow? When should you use repository secrets versus environment secrets in GitHub Actions? How do you troubleshoot a GitHub Actions job stuck queued? What is the difference between GitHub-hosted runners and self-hosted runners? How does GitHub enforce required reviewers with CODEOWNERS? Explain the internal working of GitHub Actions' merge queue? What is the difference between GitHub Actions and Jenkins? How do you implement GitOps with GitHub Actions and Kubernetes? Why use GitHub's Dependabot instead of manually tracking dependency updates? What is the difference between "uses" and "run" in a GitHub Actions step? How does GitHub Actions cache dependencies between workflow runs? When would you choose GitHub Enterprise Cloud over GitHub Team? How do you configure branch protection to enforce a pull-request-only workflow? What is the difference between GitHub Actions "on: pull_request" and "on: push" triggers? Explain the lifecycle of a GitHub issue from creation to closure? How do you optimize GitHub Actions workflow performance for a large monorepo? What is the difference between GitHub Packages and Docker Hub? How does GitHub Actions decide which workflow to trigger for a given event? Why should you use GitHub Environments to track deployments? What is the difference between repository-level and organization-level GitHub Actions secrets? How do you troubleshoot merge conflicts flagged in a GitHub pull request?
Show more question and Answers...


Comments & Discussions