diff --git a/.github/workflows/03-core-features--01-hello-world.yaml b/.github/_workflows/03-core-features--01-hello-world.yaml similarity index 100% rename from .github/workflows/03-core-features--01-hello-world.yaml rename to .github/_workflows/03-core-features--01-hello-world.yaml diff --git a/.github/workflows/03-core-features--02-step-types.yaml b/.github/_workflows/03-core-features--02-step-types.yaml similarity index 100% rename from .github/workflows/03-core-features--02-step-types.yaml rename to .github/_workflows/03-core-features--02-step-types.yaml diff --git a/.github/workflows/03-core-features--03-workflows-jobs-steps.yaml b/.github/_workflows/03-core-features--03-workflows-jobs-steps.yaml similarity index 100% rename from .github/workflows/03-core-features--03-workflows-jobs-steps.yaml rename to .github/_workflows/03-core-features--03-workflows-jobs-steps.yaml diff --git a/.github/workflows/03-core-features--04-triggers-and-filters.yaml b/.github/_workflows/03-core-features--04-triggers-and-filters.yaml similarity index 100% rename from .github/workflows/03-core-features--04-triggers-and-filters.yaml rename to .github/_workflows/03-core-features--04-triggers-and-filters.yaml diff --git a/.github/workflows/03-core-features--05-environment-variables.yaml b/.github/_workflows/03-core-features--05-environment-variables.yaml similarity index 100% rename from .github/workflows/03-core-features--05-environment-variables.yaml rename to .github/_workflows/03-core-features--05-environment-variables.yaml diff --git a/.github/workflows/03-core-features--06-passing-data.yaml b/.github/_workflows/03-core-features--06-passing-data.yaml similarity index 100% rename from .github/workflows/03-core-features--06-passing-data.yaml rename to .github/_workflows/03-core-features--06-passing-data.yaml diff --git a/.github/workflows/03-core-features--07-secrets-and-variables.yaml b/.github/_workflows/03-core-features--07-secrets-and-variables.yaml similarity index 100% rename from .github/workflows/03-core-features--07-secrets-and-variables.yaml rename to .github/_workflows/03-core-features--07-secrets-and-variables.yaml diff --git a/.github/workflows/04-advanced-features--01-runner-types.yaml b/.github/_workflows/04-advanced-features--01-runner-types.yaml similarity index 100% rename from .github/workflows/04-advanced-features--01-runner-types.yaml rename to .github/_workflows/04-advanced-features--01-runner-types.yaml diff --git a/.github/workflows/04-advanced-features--02-artifacts.yaml b/.github/_workflows/04-advanced-features--02-artifacts.yaml similarity index 100% rename from .github/workflows/04-advanced-features--02-artifacts.yaml rename to .github/_workflows/04-advanced-features--02-artifacts.yaml diff --git a/.github/workflows/04-advanced-features--03-caching.yaml b/.github/_workflows/04-advanced-features--03-caching.yaml similarity index 100% rename from .github/workflows/04-advanced-features--03-caching.yaml rename to .github/_workflows/04-advanced-features--03-caching.yaml diff --git a/.github/workflows/04-advanced-features--04-github-permissions.yaml b/.github/_workflows/04-advanced-features--04-github-permissions.yaml similarity index 100% rename from .github/workflows/04-advanced-features--04-github-permissions.yaml rename to .github/_workflows/04-advanced-features--04-github-permissions.yaml diff --git a/.github/workflows/04-advanced-features--05-third-party-auth.yaml b/.github/_workflows/04-advanced-features--05-third-party-auth.yaml similarity index 100% rename from .github/workflows/04-advanced-features--05-third-party-auth.yaml rename to .github/_workflows/04-advanced-features--05-third-party-auth.yaml diff --git a/.github/workflows/04-advanced-features--06-matrix-and-conditionals.yaml b/.github/_workflows/04-advanced-features--06-matrix-and-conditionals.yaml similarity index 100% rename from .github/workflows/04-advanced-features--06-matrix-and-conditionals.yaml rename to .github/_workflows/04-advanced-features--06-matrix-and-conditionals.yaml diff --git a/.github/workflows/04-advanced-features--07-dynamic-matrix.yaml b/.github/_workflows/04-advanced-features--07-dynamic-matrix.yaml similarity index 100% rename from .github/workflows/04-advanced-features--07-dynamic-matrix.yaml rename to .github/_workflows/04-advanced-features--07-dynamic-matrix.yaml diff --git a/.github/workflows/04-advanced-features--08-workflow-commands.yaml b/.github/_workflows/04-advanced-features--08-workflow-commands.yaml similarity index 100% rename from .github/workflows/04-advanced-features--08-workflow-commands.yaml rename to .github/_workflows/04-advanced-features--08-workflow-commands.yaml diff --git a/.github/workflows/06-authoring-actions--01-composite-action.yaml b/.github/_workflows/06-authoring-actions--01-composite-action.yaml similarity index 100% rename from .github/workflows/06-authoring-actions--01-composite-action.yaml rename to .github/_workflows/06-authoring-actions--01-composite-action.yaml diff --git a/.github/workflows/06-authoring-actions--02-reuseable-workflows-source.yaml b/.github/_workflows/06-authoring-actions--02-reuseable-workflows-source.yaml similarity index 100% rename from .github/workflows/06-authoring-actions--02-reuseable-workflows-source.yaml rename to .github/_workflows/06-authoring-actions--02-reuseable-workflows-source.yaml diff --git a/.github/workflows/06-authoring-actions--03-reuseable-workflows-caller.yaml b/.github/_workflows/06-authoring-actions--03-reuseable-workflows-caller.yaml similarity index 100% rename from .github/workflows/06-authoring-actions--03-reuseable-workflows-caller.yaml rename to .github/_workflows/06-authoring-actions--03-reuseable-workflows-caller.yaml diff --git a/.github/workflows/06-authoring-actions--04-javascript-actions.yaml b/.github/_workflows/06-authoring-actions--04-javascript-actions.yaml similarity index 100% rename from .github/workflows/06-authoring-actions--04-javascript-actions.yaml rename to .github/_workflows/06-authoring-actions--04-javascript-actions.yaml diff --git a/.github/workflows/06-authoring-actions--05-container-actions.yaml b/.github/_workflows/06-authoring-actions--05-container-actions.yaml similarity index 100% rename from .github/workflows/06-authoring-actions--05-container-actions.yaml rename to .github/_workflows/06-authoring-actions--05-container-actions.yaml diff --git a/.github/workflows/08-developer-experience--01-externalize-logic.yaml b/.github/_workflows/08-developer-experience--01-externalize-logic.yaml similarity index 100% rename from .github/workflows/08-developer-experience--01-externalize-logic.yaml rename to .github/_workflows/08-developer-experience--01-externalize-logic.yaml diff --git a/.github/workflows/08-developer-experience--02-ssh-breakpoint.yaml b/.github/_workflows/08-developer-experience--02-ssh-breakpoint.yaml similarity index 100% rename from .github/workflows/08-developer-experience--02-ssh-breakpoint.yaml rename to .github/_workflows/08-developer-experience--02-ssh-breakpoint.yaml diff --git a/.github/workflows/08-developer-experience--03-debug-env-vars.yaml b/.github/_workflows/08-developer-experience--03-debug-env-vars.yaml similarity index 100% rename from .github/workflows/08-developer-experience--03-debug-env-vars.yaml rename to .github/_workflows/08-developer-experience--03-debug-env-vars.yaml diff --git a/.github/workflows/09-best-practices--01-cache-benchmark.yaml b/.github/_workflows/09-best-practices--01-cache-benchmark.yaml similarity index 100% rename from .github/workflows/09-best-practices--01-cache-benchmark.yaml rename to .github/_workflows/09-best-practices--01-cache-benchmark.yaml diff --git a/.github/workflows/1-helllo-world.yaml b/.github/workflows/1-helllo-world.yaml new file mode 100644 index 00000000..6ca922be --- /dev/null +++ b/.github/workflows/1-helllo-world.yaml @@ -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!" diff --git a/.github/workflows/2-core-features-1.yaml b/.github/workflows/2-core-features-1.yaml new file mode 100644 index 00000000..4d9e6798 --- /dev/null +++ b/.github/workflows/2-core-features-1.yaml @@ -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" diff --git a/.github/workflows/2-core-features-2-triggers-and-filters.yaml b/.github/workflows/2-core-features-2-triggers-and-filters.yaml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/4-environment-variables.yaml b/.github/workflows/4-environment-variables.yaml new file mode 100644 index 00000000..0a101dd3 --- /dev/null +++ b/.github/workflows/4-environment-variables.yaml @@ -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" diff --git a/.github/workflows/5-passing-variables.yaml b/.github/workflows/5-passing-variables.yaml new file mode 100644 index 00000000..17e47190 --- /dev/null +++ b/.github/workflows/5-passing-variables.yaml @@ -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}" diff --git a/.github/workflows/6-caching.yaml b/.github/workflows/6-caching.yaml new file mode 100644 index 00000000..5b57fab0 --- /dev/null +++ b/.github/workflows/6-caching.yaml @@ -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 diff --git a/git-push.sh b/git-push.sh new file mode 100755 index 00000000..deb15dfa --- /dev/null +++ b/git-push.sh @@ -0,0 +1,6 @@ +#!bin/bash + +git add . +read -p "Enter commit message: " choice +git commit -m "$choice" +git push origin main