Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/1-helllo-world.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Hello World

on:
workflow_dispatch:

jobs:
say-hello-inline-bash:
runs-on: ubuntu-24.04
steps:
- run: echo "Hello, World from inline bash script in a GitHub Actions Workflow!"

say-hello-inline-python:
runs-on: ubuntu-24.04
steps:
- run: print("Hello, World from inline Python script! in a GitHub Actions Workflow!")
shell: python

say-hello-action:
runs-on: ubuntu-24.04
steps:
- uses: actions/hello-world-javascript-action@v1
with:
who-to-greet: "Hello, World from a JavaScript Action in a GitHub Actions Workflow!"
31 changes: 31 additions & 0 deletions .github/workflows/2-core-features-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Workflows, Jobs, and Steps

on:
workflow_dispatch:

jobs:
job-1:
runs-on: ubuntu-24.04
steps:
- run: echo "This is job consists of "
- run: echo "one or more steps"
- run: echo "Which run sequentially"
- run: echo "within the same compute environment"
job-2:
runs-on: ubuntu-24.04
steps:
- run: echo "Multiple jobs can run in parallel"
job-3:
runs-on: ubuntu-24.04
needs:
- job-1
- job-2
steps:
- run: echo "They can also depend on one another"
job-4:
runs-on: ubuntu-24.04
needs:
- job-2
- job-3
steps:
- run: echo "... to from a directed acyclic graph (DAG) of jobs"
Empty file.
33 changes: 33 additions & 0 deletions .github/workflows/4-environment-variables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Environment Variables
on:
workflow_dispatch:

env:
WORKFLOW_VAR: "I_AM_WORKFLOW_SCOPED"

jobs:
job-1:
runs-on: ubuntu-24.04
env:
JOB_VAR: "I_AM_JOB_SCOPED"
steps:
- name: Inspect scopes job 1 step 1
env:
STEP_VAR: "I_AM_STEP_SCOPED"
run: |
echo "Workflow Scoped Variable: $WORKFLOW_VAR"
echo "Job Scoped Variable: $JOB_VAR"
echo "Step Scoped Variable: $STEP_VAR"
- name: Inspect scopes job 1 step 2
run: |
echo "Workflow Scoped Variable: $WORKFLOW_VAR"
echo "Job Scoped Variable: $JOB_VAR"
echo "Step Scoped Variable: $STEP_VAR"
job-2:
runs-on: ubuntu-24.04
steps:
- name: Inspect scopes job 2 step 2
run: |
echo "Workflow Scoped Variable: $WORKFLOW_VAR"
echo "Job Scoped Variable: $JOB_VAR"
echo "Step Scoped Variable: $STEP_VAR"
30 changes: 30 additions & 0 deletions .github/workflows/5-passing-variables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Passing Variables between Jobs

on:
workflow_dispatch:

jobs:
producer:
runs-on: ubuntu-24.04
outputs:
foo: ${{ steps.generate-foo.outputs.foo }}
steps:
- name: Generate and Export foo
id: generate-foo
run: |
foo=bar
echo "foo=${foo}" >> $GITHUB_OUTPUT
echo "FOO=${foo}" >> $GITHUB_ENV
- name: Inspect values inside producer
run: |
echo "FOO (set via GitHub_ENV): $FOO"
echo "foo (set via GitHub_OUTPUT): ${{ steps.generate-foo.outputs.foo }}"

consumer:
runs-on: ubuntu-24.04
needs: producer
steps:
- name: Inspect values inside consumer
run: |
echo "Value from producer : ${{ needs.producer.outputs.foo }}"
echo "FOO in consumer : ${FOO}"
23 changes: 23 additions & 0 deletions .github/workflows/6-caching.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Caching

on:
workflow_dispatch:

jobs:
node-cache:
name: npm dependency cache (set up node)
runs-on: ubuntu-24.04
defaults:
run:
working-directory: 04-advanced-features/caching/minimal-node-project
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: 04-advanced-features/caching/minimal-node-project/package-lock.json
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: List first few modules
run: ls -R node_modules | head
6 changes: 6 additions & 0 deletions git-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!bin/bash

git add .
read -p "Enter commit message: " choice
git commit -m "$choice"
git push origin main