GitHub Actions Workshop

Master GitHub Actions with hands-on labs and exercises. Learn how to automate workflows, run tests, deploy applications, and more using GitHub's powerful automation platform. This repository has everything you need to get started with continuous integration and continuous deployment.


Project maintained by prasadhonrao Hosted on GitHub Pages — Theme by mattgraham

Solution: Reusable Workflow

Reusable Echo Workflow

name: Reusable Workflow Echo
on:
  workflow_call:
    inputs:
      my-input:
        required: true
        type: string
jobs:
  echo:
    runs-on: ubuntu-latest
    steps:
      - name: Echo input
        run: echo $

Reusable Workflow Echo Caller

name: Reusable Workflow Echo Caller

on:
  workflow_dispatch:
  push:
    paths:
      - '.github/workflows/reusable-workflow-echo-caller.yml'
jobs:
  say-hello:
    uses: ./.github/workflows/reusable-workflow-echo.yml
    with:
      my-input: 'Hello, world!'
  say-goodbye:
    uses: ./.github/workflows/reusable-workflow-echo.yml
    with:
      my-input: 'Goodbye!'