APURV
  • Home
  • Journey
  • Projects
  • Blogs
  • Interview
  • Exams
Resume
APURV

Building scalable, secure, and production-ready cloud infrastructure. Automation first.

NAVIGATION

HomeExperienceProjectsCertificationsSkills

TECH STACK

AWSGCPK8sCI/CDLinuxDocker

CONNECT

LinkedInGitHubEmailResume

Β© 2026 Apurv Gujjar. All rights reserved.
APURV
  • Home
  • Journey
  • Projects
  • Blogs
  • Interview
  • Exams
Resume
HomeInterview PortalGitHub Actions
Workflows β€’ Actions β€’ Runners
ALL HANDBOOKS
🎯LinuxπŸ™Git & GitHubπŸ€–GitHub Actions🌐Networking☁AWSπŸ› Terraform🐳Docker☸KubernetesπŸ”„GitOpsπŸ“ŠMonitoringπŸ›‘DevSecOpsβš™SREπŸ—System DesignπŸ’°Cost Optimization🚨Incident ScenariosπŸ‘€HR & Behavioral☁GCP🐍Python☁AWS Architect
πŸ€–

GitHub Actions

// INTERVIEW & ARCHITECTURE HANDBOOK
Workflows β€’ Actions β€’ Runners

Learn GitHub Actions core architecture, production scenario-based questions, incident response, and real-world engineering solutions.

πŸ€– GitHub Actions: Interactive Q&A Handbook#



🟒 GitHub Actions Advanced Q&A#

❓ Q1: What is GitHub Actions, and how does it process workflows under the hood?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: GitHub Actions is an API-driven workflow automation and CI/CD platform integrated directly into GitHub. It allows you to automate tasksβ€”such as building, testing, packaging, and deploying codeβ€”directly in response to repository events (e.g., code pushes, pull requests, release creation, or cron schedules).

❓ Q2: Can you list and explain the key architectural components of GitHub Actions?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  • Workflows: Automated procedures defined in YAML files located in .github/workflows/.
  • Events: Specific activities that trigger a workflow (e.g., push, pull_request, schedule).
  • Jobs: A set of steps that execute on the same runner. Jobs run in parallel by default, but can be configured to run sequentially using needs.
  • Steps: Individual tasks running commands or actions. Steps run sequentially.
  • Actions: Standalone, reusable commands or custom application integrations (e.g., actions/checkout).
  • Runners: The underlying virtual machines or containers executing the steps.

❓ Q3: How do you configure workflow triggers, and what is the syntax for defining manual execution parameters?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Workflow triggers are defined under the on: block. To configure manual execution, use the workflow_dispatch trigger:

on:
  workflow_dispatch:
    inputs:
      environment:
        description: 'Target Environment'
        required: true
        default: 'staging'

This enables an "Run workflow" button in the GitHub Actions UI.

❓ Q4: What is a matrix strategy in GitHub Actions, and in what scenarios would you use it?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: A matrix strategy runs multiple jobs containing variations of input configurations in parallel:

strategy:
  matrix:
    os: [ubuntu-latest, windows-latest, macos-latest]
    node-version: [16, 18, 20]

This is useful for cross-platform testing of libraries, applications, or packages across different language environments and OS distributions.

❓ Q5: How do GitHub-hosted runners compare to self-hosted runners? When is self-hosting required?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  • GitHub-hosted runners: Virtual machines managed by GitHub (Azure VMs under the hood). They are clean, isolated, and provisioned on-demand, but have execution limits and cannot easily access resources inside private corporate VPCs.
  • Self-Hosted runners: Servers or containers you provision, manage, and pay for yourself. They can run on-premises or in your private VPC, allowing direct access to internal databases and APIs, and support custom hardware specs and persistent build caching.

❓ Q6: How do environments and environment protection rules help secure deployments to production?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Environments describe target deployment destinations (e.g., production, staging). You can configure protection rules on environments:

  • Required Reviewers: Halts the workflow run until a designated team member approves it.
  • Wait Timer: Delays execution for a specified duration.
  • Deployment Branches: Restricts deployments to specific branches (e.g., only main).

❓ Q7: Why should we use OpenID Connect (OIDC) integration for cloud auth instead of storing static AWS credentials?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Storing long-lived AWS IAM access keys in GitHub Secrets poses a significant security risk if the credentials are leaked. OIDC establishes a trust relationship between GitHub and your cloud provider (e.g., AWS IAM). The workflow requests a short-lived, single-use JWT token from GitHub's OIDC provider. AWS validates the token signature and returns temporary credentials (valid for e.g., 1 hour) using sts:AssumeRoleWithWebIdentity, eliminating the need to store static cloud credentials in GitHub.

❓ Q8: How do we implement caching in GitHub Actions to speed up dependency installation times?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Use actions/cache or built-in package manager integrations (like actions/setup-node cache option) to save dependency folders (e.g., node_modules or .m2 repository).

  • During a run, the action checks for a cache matching a key (usually a hash of the project's lock file: package-lock.json).
  • If a cache hit occurs, it restores the folder, reducing package install times from minutes to seconds.

❓ Q9: Since jobs run in isolated virtual environments, how do we pass build artifacts from a build job to a deploy job?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Jobs run in isolated environments and do not share disk space. To pass files:

  1. Use actions/upload-artifact in the builder job to upload files (e.g., compiled binary, zip archive) to GitHub's storage.
  2. Use actions/download-artifact in the consumer/deployer job to fetch files back down into the local runner filesystem.

❓ Q10: How do concurrency groups work, and how do you configure a workflow to automatically cancel in-progress runs when a new commit is pushed?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Concurrency groups allow restricting execution to only one job or workflow run at a time per group (e.g., per branch or per environment):

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

Setting cancel-in-progress: true automatically terminates active, older builds if a new push triggers a newer build, saving runner minutes.

❓ Q11: How do you manage and inject encrypted secrets into our workflow runs securely?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  1. Configure secrets in the Repository Settings -> Secrets and Variables.
  2. Reference them in the workflow YAML using the secrets context: ${{ secrets.API_TOKEN }}.
  3. GitHub automatically masks these values in runner stdout/stderr logs.

❓ Q12: What is the difference between 'run' and 'uses' in a workflow step definition?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  • run: Executes shell command lines (e.g., run: npm install or run: echo "hello").
  • uses: Calls a pre-authored, reusable Action published in the GitHub Marketplace or in another repository (e.g., uses: actions/checkout@v4).

❓ Q13: What are composite actions, and why would we use them instead of repeating YAML code?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: A composite action package groups multiple workflow steps into a single reusable action, allowing developers to dry-run and standardize common build/test operations across multiple repositories without duplicate yaml blocks.

❓ Q14: If a workflow fails, what is your systematic troubleshooting process?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  • Review runner log files directly in the GitHub Actions UI.
  • Enable debug logging by creating repository variables ACTIONS_STEP_DEBUG and ACTIONS_RUNNER_DEBUG set to true.
  • Verify that secrets are correctly mapped, and check runner system stats.

❓ Q15: What are Reusable Workflows, and how do they differ from composite actions?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Reusable Workflows allow you to define a complete workflow YAML file in a central repository and call it from other workflow files across multiple repositories (using uses: owner/repo/.github/workflows/reusable.yml@v1).

  • Unlike composite actions, reusable workflows run as independent jobs, can contain multiple jobs, define environment boundaries, and support their own runner configurations.
  • They are triggered using the workflow_call event and accept defined inputs and secrets.

❓ Q16: Can you summarize when to choose a Reusable Workflow over a Composite Action?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

FeatureReusable Workflows (workflow_call)Composite Actions
ExecutionRuns as a standalone job or multiple jobs.Runs as a set of steps within an existing job.
SecretsSecrets are explicitly passed using the secrets: keyword.Inherits secrets directly from the host job's context.
RunnersCan declare custom runner types (runs-on) inside it.Runs on the runner specified by the caller job.
Multi-jobYes, can contain multiple dependent jobs.No, only supports sequential steps.

❓ Q17: What security measures must be put in place when operating self-hosted runners?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  • Never use self-hosted runners for public repositories: Fork pull requests can run arbitrary code on your private servers (remote code execution).
  • Use Ephemeral Runners: Configure runners to register, execute exactly one job, and automatically deregister and self-destruct (using transient containers or auto-scaling groups).
  • Network Isolation: Place runners in private subnets with no public inbound rules; allow outbound HTTPS connections to GitHub endpoints only.
  • Non-Root Execution: Run the runner agent process using a non-privileged system user (USER runner).

❓ Q18: How do you construct a pipeline that deploys to staging first, and then to production only if staging succeeds?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Configure dependent jobs using the needs keyword and target environments:

jobs:
  deploy-staging:
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - run: echo "Deploying to Staging..."
  deploy-prod:
    runs-on: ubuntu-latest
    needs: deploy-staging
    environment: production
    steps:
      - run: echo "Deploying to Production..."

❓ Q19: How do you implement a manual approval gate for production deployments?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  1. Define an environment (e.g., production) in the GitHub Repository Settings.
  2. Configure Required Reviewers under the Environment Protection Rules.
  3. Reference the environment in your workflow job (environment: production). When the workflow runs, execution pauses on this job and notifies reviewers to approve or reject the deployment.

❓ Q20: What steps do you take to prevent credentials and secrets from leaking into the build runner logs?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  • Use GitHub's default Secrets mechanism; GitHub automatically masks secret strings with *** in stdout/stderr logs.
  • Avoid echo commands that debug or print variables containing secrets.
  • Enable Secret Scanning on the repository to block pushes containing keys, API tokens, or certificates.
  • Implement tools like Trufflehog or gitleaks as pre-commit hooks or early pipeline stages to scan source code changes.

❓ Q21: How do you sign build artifacts or container images within a GitHub Actions run to verify their authenticity?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Use Cosign (from Sigstore) to sign container images using GitHub's OIDC identity:

  1. Authenticate to AWS/GCP using OIDC to fetch short-lived registry credentials.
  2. Build and push the Docker image to your container registry.
  3. Install Cosign in the runner workflow.
  4. Run cosign sign --yes <image-digest> utilizing keyless signing. Cosign validates the runner's OIDC JWT identity and records the signature in the Sigstore transparency log (Rekor).

❓ Q22: Explain the difference between Continuous Integration (CI) and Continuous Deployment (CD).#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer:

  • Continuous Integration (CI): Involves automatically building, packaging, and testing code changes as soon as developers commit them to a shared version control repository (usually Git). This helps catch code conflicts and test failures early in the cycle.
  • Continuous Deployment (CD): Takes CI a step further by automatically deploying every code change that successfully passes the integration and testing phase directly to the production environment, ensuring fast and continuous value delivery without manual intervention. Combined, they form the CI/CD pipeline, which adds stability, consistency, and agility to the software delivery lifecycle.

❓ Q23: What are some popular CI/CD tools, and how do on-premises models compare to SaaS models?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Popular CI/CD tools can be grouped into two main deployment models:

1. On-Premises / Self-Hosted Tools#

These are installed and maintained on your own infrastructure, providing absolute control over network security and access:

  • Jenkins: The industry-standard open-source automation server.
  • GitLab CI/CD: A robust tool built directly into the self-hosted GitLab platform.
  • Bamboo: Atlassian's commercial CI/CD solution that integrates with Jira.
  • TeamCity: JetBrains' powerful build management and continuous integration tool.

2. Cloud-Based / SaaS Tools#

These are fully managed cloud platforms where the provider hosts the build runners and infrastructure:

  • GitHub Actions: Workflow automation integrated directly into GitHub.
  • CircleCI: Fast, cloud-native pipelines featuring container-first builds.
  • GitLab CI/CD (SaaS): The cloud-hosted version of GitLab's pipeline runner.
  • Azure DevOps: Microsoft's enterprise suite for planning, testing, and deployment.
  • Bitbucket Pipelines: Integrated cloud pipelines inside Bitbucket repositories.

❓ Q24: What is a build pipeline, and what are its typical execution stages?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: A build pipeline is an automated set of sequential processes that compiles raw source code, resolves dependencies, executes tests, runs code quality checks, and generates executable deployment packages (artifacts like binaries, JARs, or Docker images).

Typical Stages of a Build Pipeline:#

  1. Source Retrieval: Pulls the latest commits from the version control system.
  2. Compilation & Assembly: Builds binaries from source code.
  3. Unit Testing: Runs rapid isolated code tests.
  4. Static Analysis: Audits code syntax and security dependencies (e.g., SonarQube, Snyk).
  5. Artifact Generation: Packages the application into an image or archive.
  6. Registry Push: Uploads the stable image/package to an artifact registry.

❓ Q25: How do you optimize a CI/CD pipeline for both speed and reliability?#

Click on the dropdown below to reveal the technical answer.

πŸ’‘ Reveal Technical Answer

Answer: Optimizing a CI/CD pipeline is essential to maintain fast feedback loops and prevent delivery bottlenecks:

  • Parallel Job Execution: Run independent tasks (e.g., frontend linting, backend unit tests, static security scans) concurrently instead of sequentially.
  • Optimize Dependency Caching: Configure cache sharing for package managers (e.g., caching node_modules, .m2 repository, pip cache) across pipeline runs to prevent downloading dependencies from scratch.
  • Use Multi-Stage Docker Builds: Build application assets inside temporary containers, copying only final production files to keep target image layers minimal.
  • Incremental Builds: Build only modules or directories containing files changed in the triggering Git diff.
  • Prioritize Testing Stages (Fail-Fast): Run fast, lightweight syntax checks and unit tests first, reserving slow, resource-heavy integration and system end-to-end tests for later stages.
  • Dedicated & Scalable Runners: Host runners on auto-scaling clusters (e.g., Kubernetes runners using ephemeral pods) to prevent job queuing during peak hours.

Git & GitHubBack to PortalNetworking
On This Page
GitHub Actions Advanced Q&A
APURV

Building scalable, secure, and production-ready cloud infrastructure. Automation first.

NAVIGATION

HomeExperienceProjectsCertificationsSkills

TECH STACK

AWSGCPK8sCI/CDLinuxDocker

CONNECT

LinkedInGitHubEmailResume

Β© 2026 Apurv Gujjar. All rights reserved.