0
0
Gitdevops~10 mins

GitHub Actions basics - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - GitHub Actions basics
Push code to GitHub
GitHub detects push event
Trigger GitHub Actions workflow
Run defined jobs and steps
Jobs execute commands (build, test, deploy)
Workflow completes with success or failure
Status shown on GitHub repository
This flow shows how pushing code to GitHub triggers a workflow that runs jobs and steps, then reports the result.
Execution Sample
Git
name: CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Hello from GitHub Actions!"
This workflow runs on every push and prints a message in the job.
Process Table
StepActionEvaluationResult
1Push code to GitHubEvent detectedWorkflow triggered
2Start job 'build'Runs on ubuntu-latestJob environment ready
3Run step: echo messageExecute shell commandOutput: Hello from GitHub Actions!
4Job completesNo errorsJob success
5Workflow completesAll jobs doneWorkflow success status shown
💡 Workflow ends after all jobs and steps finish successfully.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Workflow statusNot startedTriggeredRunningRunningSuccess
Job statusNot startedNot startedRunningSuccessSuccess
Step outputNoneNoneNoneHello from GitHub Actions!Hello from GitHub Actions!
Key Moments - 3 Insights
Why does the workflow start when I push code?
Because the workflow is set to trigger on the 'push' event, as shown in execution_table step 1.
What does 'runs-on: ubuntu-latest' mean?
It means the job runs on a fresh Ubuntu virtual machine provided by GitHub, as seen in step 2.
How do I know if my command ran successfully?
The command output appears in step 3, and the job success in step 4 confirms no errors.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the workflow status after step 2?
ARunning
BSuccess
CNot started
DFailed
💡 Hint
Check the 'Workflow status' row in variable_tracker after Step 2.
At which step does the job environment become ready?
AStep 1
BStep 2
CStep 3
DStep 4
💡 Hint
Look at the 'Action' and 'Result' columns in execution_table for job start.
If the echo command failed, what would change in the execution table?
AStep 1 would not trigger the workflow
BStep 2 would not run the job
CStep 3 would show an error output and Step 4 would show failure
DStep 5 would show success anyway
💡 Hint
Refer to step 3 and 4 in execution_table for command execution and job completion.
Concept Snapshot
GitHub Actions basics:
- Trigger workflows on events like push
- Define jobs with 'runs-on' to set environment
- Jobs have steps that run commands
- Workflow status shows success or failure
- Outputs appear in job logs
Full Transcript
GitHub Actions basics start when you push code to your GitHub repository. This push event triggers a workflow defined in a YAML file. The workflow runs jobs on virtual machines like 'ubuntu-latest'. Each job runs steps, which are commands like printing messages or running tests. The workflow ends with a success or failure status shown on GitHub. This visual trace shows each step from push to workflow completion, tracking status and outputs clearly.