DEV Community

Discussion on: What's the difference between a GitHub action and a workflow?

Collapse
 
shehab7osny profile image
Shehab Hosny

Thank you a lot @mishmanners for the post! It was really helpful. However, I do think that GitHub Marketplace link needs to be adjuested as it is currently poinitng to github.blog serach results.

I also thought it would be helpful to post a sample workflow including all of the GitHub Actions components. So, here is a GitHub Actions Workflow example:


release.yml

# Workflow Name
name: Release Process

on:
  # Events
  push:
    branches:
      - main

jobs:
  # Jobs
  generate-release:
    name: Create GitHub Release
    # Runner OS
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repository
      # Actions
      uses: actions/checkout@v2
Enter fullscreen mode Exit fullscreen mode

For the above code snippet:

  • Workflow ➡️ release.yml
    Workflow Name ➡️ Release Process

  • Event ➡️ push

  • Job ➡️ generate-release
    Job Name ➡️ Create GitHub Release

  • Runner OS ➡️ ubuntu-latest

  • Step Name ➡️ Checkout Repository

  • Action ➡️ actions/checkout@v2

I hope this was helpful!

Collapse
 
mishmanners profile image
Michelle Mannering

Oh yay, thank you! Thanks for catching the link. The second one is correct. The first is now fixed. Thanks for posting this too. Super helpful

Collapse
 
shehab7osny profile image
Shehab Hosny

Thank you! Glad it was helpful 😊