Skip to content

Commit de73d19

Browse files
committed
Merge branch 'main' into path-filter-include
2 parents df73e8e + 3cf4cfa commit de73d19

600 files changed

Lines changed: 441334 additions & 85 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Hello World
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
say-hello-inline-bash:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- run: echo "Hello from an inline bash script in a GitHub Action Workflow!"

.github/workflows/01-hello-world.yaml renamed to .github/workflows/03-core-features--02-step-types.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
name: Hello World
1+
name: Step Types
2+
23
on:
3-
# push:
4-
# branches:
5-
# - main
64
workflow_dispatch:
5+
76
jobs:
8-
say-hello-inline:
7+
say-hello-inline-bash:
98
runs-on: ubuntu-24.04
109
steps:
1110
- run: echo "Hello from an inline bash script in a GitHub Action Workflow!"
1211

12+
say-hello-inline-python:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- run: print("Hello from an inline python script in a GitHub Action Workflow!")
16+
shell: python
17+
1318
say-hello-action:
1419
runs-on: ubuntu-24.04
1520
steps:

.github/workflows/02-workflows-jobs-steps.yaml renamed to .github/workflows/03-core-features--03-workflows-jobs-steps.yaml

File renamed without changes.

.github/workflows/03-triggers.yaml renamed to .github/workflows/03-core-features--04-triggers-and-filters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ on:
1818
- reopened
1919
paths:
2020
# include markdown files
21-
- "02-mechanics-core/filters/*.md"
21+
- "03-core-features/filters/*.md"
2222
# Exclude txt files
23-
- "!02-mechanics-core/filters/*.txt"
23+
- "!03-core-features/filters/*.txt"
2424

2525
### https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
2626
# schedule:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Environment Variables
2+
on:
3+
workflow_dispatch:
4+
env:
5+
WORKFLOW_VAR: I_AM_WORKFLOW_SCOPED
6+
7+
jobs:
8+
job-1:
9+
runs-on: ubuntu-24.04
10+
env:
11+
JOB_VAR: I_AM_JOB_1_SCOPED
12+
steps:
13+
- name: Inspect scopes job 1 step 1
14+
env:
15+
STEP_VAR: I_AM_STEP_SCOPED
16+
run: |
17+
echo "WORKFLOW_VAR: $WORKFLOW_VAR" # visible
18+
echo "JOB_VAR: $JOB_VAR" # visible
19+
echo "STEP_VAR: $STEP_VAR" # visible only here
20+
21+
- name: Inspect scopes job 1 step 2
22+
env:
23+
STEP_VAR: I_AM_STEP_SCOPED
24+
run: |
25+
echo "WORKFLOW_VAR: $WORKFLOW_VAR" # visible
26+
echo "JOB_VAR: $JOB_VAR" # visible
27+
echo "STEP_VAR: ${STEP_VAR:-<UNSET>}" # not set here
28+
29+
job-2:
30+
runs-on: ubuntu-24.04
31+
steps:
32+
- name: Inspect scopes job 2 step 2
33+
run: |
34+
echo "WORKFLOW_VAR: $WORKFLOW_VAR" # still visible
35+
echo "JOB_VAR: ${FOO:-<UNSET>}" # not set here
36+
echo "STEP_VAR: ${STEP_VAR:-<UNSET>}" # not set here
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Passing Variables Between jobs
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
producer:
7+
runs-on: ubuntu-24.04
8+
9+
outputs:
10+
foo: ${{ steps.generate-foo.outputs.foo }}
11+
steps:
12+
- name: Generate and export foo
13+
id: generate-foo
14+
run: |
15+
foo=bar
16+
17+
# 1) Step output (for job output)
18+
echo "foo=${foo}" >> "$GITHUB_OUTPUT"
19+
20+
# 2) Job-scoped environment variable
21+
echo "FOO=${foo}" >> "$GITHUB_ENV"
22+
23+
- name: Inspect values inside producer
24+
run: |
25+
echo "FOO (set via GITHUB_ENV): $FOO"
26+
echo "foo (step output): ${{ steps.generate-foo.outputs.foo }}"
27+
28+
consumer:
29+
runs-on: ubuntu-24.04
30+
needs: producer
31+
steps:
32+
- name: Inspect values inside consumer (note FOO is unset)
33+
run: |
34+
echo "Value from producer: ${{ needs.producer.outputs.foo }}"
35+
echo "FOO in consumer: ${FOO:-<UNSET>}"

.github/workflows/04-passing-data.yaml renamed to .github/workflows/03-core-features--07-secrets-and-variables.yaml

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,9 @@
1-
name: Environment Vars and Data Passing
1+
name: Secrets and Environments
22
on:
33
workflow_dispatch:
44

5-
env:
6-
GLOBAL: THIS_IS_GLOBAL_SCOPED
7-
85
jobs:
9-
job-1:
10-
runs-on: ubuntu-24.04
11-
env:
12-
JOB_1: THIS_IS_JOB_1_SCOPED
13-
14-
# Make foo available to other jobs
15-
outputs:
16-
foo: ${{ steps.generate-foo.outputs.foo }}
17-
18-
steps:
19-
- name: Generate and export foo
20-
id: generate-foo
21-
run: |
22-
foo=bar
23-
24-
# 1) Step output (for job output)
25-
echo "foo=${foo}" >> "$GITHUB_OUTPUT"
26-
27-
# 2) Job-scoped environment variable
28-
echo "FOO=${foo}" >> "$GITHUB_ENV"
29-
30-
- name: Inspect values inside job-1
31-
run: |
32-
echo "GLOBAL (workflow-level): $GLOBAL"
33-
echo "JOB_1 (job-level): $JOB_1"
34-
echo "FOO (set via GITHUB_ENV): $FOO"
35-
echo "foo (step output): ${{ steps.generate-foo.outputs.foo }}"
36-
37-
job-2:
38-
runs-on: ubuntu-24.04
39-
needs: job-1
40-
env:
41-
JOB_2: THIS_IS_JOB_2_SCOPED
42-
43-
steps:
44-
- name: Inspect values inside job-2 (note FOO is unset)
45-
run: |
46-
echo "GLOBAL (workflow-level): $GLOBAL"
47-
echo "JOB_2 (job-level): $JOB_2"
48-
echo "Value from job-1: ${{ needs.job-1.outputs.foo }}"
49-
echo "FOO in job-2: ${FOO:-<UNSET>}"
50-
51-
job-staging:
6+
staging-environment:
527
runs-on: ubuntu-24.04
538
environment: staging
549
env:
@@ -58,7 +13,6 @@ jobs:
5813
# Inject environment-level items into the shell
5914
EXAMPLE_ENVIRONMENT_SECRET: ${{ secrets.EXAMPLE_ENVIRONMENT_SECRET }}
6015
EXAMPLE_ENVIRONMENT_VARIABLE: ${{ vars.EXAMPLE_ENVIRONMENT_VARIABLE }}
61-
6216
steps:
6317
- name: Inspect values inside job
6418
run: |
@@ -67,7 +21,7 @@ jobs:
6721
echo "Env secret (masked): $EXAMPLE_ENVIRONMENT_SECRET"
6822
echo "Env variable: $EXAMPLE_ENVIRONMENT_VARIABLE"
6923
70-
job-production:
24+
production-environment:
7125
runs-on: ubuntu-24.04
7226
environment: production
7327
env:
@@ -77,25 +31,10 @@ jobs:
7731
# Inject environment-level items into the shell
7832
EXAMPLE_ENVIRONMENT_SECRET: ${{ secrets.EXAMPLE_ENVIRONMENT_SECRET }}
7933
EXAMPLE_ENVIRONMENT_VARIABLE: ${{ vars.EXAMPLE_ENVIRONMENT_VARIABLE }}
80-
8134
steps:
8235
- name: Inspect values inside job
8336
run: |
8437
echo "Repo secret (masked): $EXAMPLE_REPOSITORY_SECRET"
8538
echo "Repo variable: $EXAMPLE_REPOSITORY_VARIABLE"
8639
echo "Env secret (masked): $EXAMPLE_ENVIRONMENT_SECRET"
8740
echo "Env variable: $EXAMPLE_ENVIRONMENT_VARIABLE"
88-
89-
job-artifact:
90-
runs-on: ubuntu-24.04
91-
steps:
92-
- name: Create artifact file
93-
run: |
94-
echo "This will be stored as an artifact!" > artifact.txt
95-
echo "Generated by job-artifact on $(date)" >> artifact.txt
96-
97-
- name: Upload artifact
98-
uses: actions/upload-artifact@v4
99-
with:
100-
name: example-artifact
101-
path: artifact.txt
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Runner types
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
######################################
7+
# GITHUB (MICROSOFT) HOSTED RUNNERS
8+
######################################
9+
# GitHub provides hosted runners which run on Microsoft Azure.
10+
#
11+
# Open source projects get some free usage and pro/team/enterprise GitHub
12+
# subscriptions also come with some number of minutes included (after which
13+
# you pay based on usage.
14+
#
15+
# These are the easiest to get started with (require no additional configuration
16+
# and it makes sense to use the free minutes, but only on workflows which are not in the
17+
# critical path for your production deployments. For usage beyond your quota I suggest
18+
# looking at the below options for higher performance (and more affordable)
19+
# approaches!
20+
######################################
21+
github-hosted-ubuntu-vm:
22+
name: Ubuntu 24.04 VM
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- name: Show runner info
26+
run: |
27+
echo "Hello from ${{ runner.os }}-${{ runner.arch }}"
28+
echo "Runner name (type): ${{ runner.name }}"
29+
30+
github-hosted-windows-vm:
31+
name: Windows 2022 VM
32+
runs-on: windows-2022
33+
steps:
34+
- name: Show runner info
35+
shell: pwsh
36+
run: |
37+
echo "Hello from ${{ runner.os }}-${{ runner.arch }}"
38+
echo "Runner name (type): ${{ runner.name }}"
39+
40+
github-hosted-macos-vm:
41+
name: macOS 14 VM
42+
runs-on: macos-14
43+
steps:
44+
- name: Show runner info
45+
run: |
46+
echo "Hello from ${{ runner.os }}-${{ runner.arch }}"
47+
echo "Runner name (type): ${{ runner.name }}"
48+
49+
alpine-container-on-github-hosted-ubuntu-vm:
50+
name: Alpine container on Ubuntu VM
51+
runs-on: ubuntu-24.04
52+
container:
53+
image: alpine:3.20
54+
steps:
55+
- name: Show runner info
56+
run: |
57+
echo "Hello from ${{ runner.os }}-${{ runner.arch }}"
58+
echo "Runner name (type): ${{ runner.name }}"
59+
echo "Container image: $(grep PRETTY_NAME /etc/os-release)"
60+
61+
######################################
62+
# 3RD PARTY HOSTED RUNNERS
63+
######################################
64+
# There are companies which host GitHub Action runners that provide increased performance for less $$$
65+
#
66+
# One such company happens to be the sponsor of the course! 🙏
67+
#
68+
# ✨ Namespace Labs (https://namespace.so/) ✨
69+
#
70+
# You can likely cut your build times (and your CI bill) signiticantly by using their runners
71+
# and it only takes changing a single line of yaml:
72+
#
73+
# - runs-on: ubuntu-24.04
74+
# + runs-on: namespace-profile-default # The default as of July 2025 is Ubuntu 22.04
75+
#
76+
# (They also offer MacOS and Windows runners!)
77+
######################################
78+
namespace-ubuntu-vm:
79+
name: Namespace Ubuntu VM
80+
runs-on: namespace-profile-default
81+
steps:
82+
- name: Show runner info
83+
run: |
84+
echo "Hello from ${{ runner.os }}-${{ runner.arch }}"
85+
echo "Runner name (type): ${{ runner.name }}"
86+
87+
######################################
88+
# SELF HOSTED RUNNERS
89+
######################################
90+
# There are also methods to self-host github action runners.
91+
#
92+
# These can provide inexpensive compute, but with increased operational overhead.
93+
# They also allow you to execute within your own VPC which may or may not be important to you depending on your business
94+
#
95+
# A few of the most popular options for doing this:
96+
# - https://runs-on.com/ (run jobs as EC2 instances in AWS)
97+
# - https://github.com/actions/actions-runner-controller (run jobs in any Kubernetes cluster)
98+
# - https://docs.railway.com/tutorials/github-actions-runners (run jobs on Railway)
99+
#
100+
# Configuration/usage of these is outside the scope of this course, and is left as an exercise for the reader
101+
######################################
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Artifacts
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
artifact-producer:
7+
name: Produce artifact
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- name: Create artifact file
11+
run: |
12+
echo "This will be stored as an artifact!" > artifact.txt
13+
echo "Generated by artifact-producer job on $(date)" >> artifact.txt
14+
15+
- name: Upload artifact
16+
uses: actions/upload-artifact@v4
17+
with:
18+
name: example-artifact
19+
path: artifact.txt
20+
21+
artifact-consumer:
22+
name: Consume artifact
23+
runs-on: ubuntu-24.04
24+
needs: artifact-producer
25+
steps:
26+
- name: Download artifact
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: example-artifact
30+
31+
- name: Cat artifact file
32+
run: cat artifact.txt

0 commit comments

Comments
 (0)