From 8d907d9a7335ac52ee75f2beccde89de9a64faf1 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 13:17:42 -0700 Subject: [PATCH 01/14] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index e8540e80..b85c4d29 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -2,7 +2,11 @@ name: 01-1. GitHub Actions Demo on: workflow_dispatch: workflow_call: - +push: + branches: + - main + paths: + - 'labs/**' jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest From 323b9c8a4bec5239af560b0eb0b2fe52a199a165 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 13:21:39 -0700 Subject: [PATCH 02/14] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index b85c4d29..4db72007 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -24,3 +24,12 @@ jobs: - run: echo "🍏 This job's status is ${{ job.status }}." - name: Adding markdown run: echo "### Hello world! :rocket:" >> "$GITHUB_STEP_SUMMARY" + # This step uses GitHub's hello-world-javascript-action: https://github.com/actions/hello-world-javascript-action + - name: Hello world + uses: actions/hello-world-javascript-action@main + with: + who-to-greet: "Mona the Octocat" + id: hello + # This step prints an output (time) from the previous step's action. + - name: Echo the greeting's time + run: echo 'The time was ${{ steps.hello.outputs.time }}.' From 7df6488b63369c389085e06fe2f6f811da26392e Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 13:22:20 -0700 Subject: [PATCH 03/14] Update setup.md --- labs/setup.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/labs/setup.md b/labs/setup.md index 2cd443dc..cbd6cda4 100644 --- a/labs/setup.md +++ b/labs/setup.md @@ -29,4 +29,5 @@ References: - [ ] Module 6: Self-hosted runners - [ ] Module 7: CI/CD ``` -7. Fetch upstream to get the latest changes from the upstream repository \ No newline at end of file +7. Fetch upstream to get the latest changes from the upstream repository +8. the end From 2daae334adab3855ebcf7205b3dfb15bf014a9b8 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 13:25:20 -0700 Subject: [PATCH 04/14] Update github-actions-demo.yml --- .github/workflows/github-actions-demo.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 4db72007..1c63b17f 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -33,3 +33,12 @@ jobs: # This step prints an output (time) from the previous step's action. - name: Echo the greeting's time run: echo 'The time was ${{ steps.hello.outputs.time }}.' + # This step uses GitHub's hello-world-javascript-action: https://github.com/actions/hello-world-javascript-action + - name: Hello world + uses: actions/hello-world-javascript-action@main + with: + who-to-greet: "Mona the Octocat" + id: hello + # This step prints an output (time) from the previous step's action. + - name: Echo the greeting's time + run: echo 'The time was ${{ steps.hello.outputs.time }}.' From c29be6b4f5257171778ada64923decdcbd88638c Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 13:28:59 -0700 Subject: [PATCH 05/14] Update job-dependencies.yml --- .github/workflows/job-dependencies.yml | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index e773fe04..541d700c 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -31,3 +31,37 @@ jobs: needs: [fanout1, fanout2] steps: - run: echo "This job will run after fanout1 and fanout2 have finished." + build: + runs-on: windows-latest + steps: + - run: echo "This job will be run in parallel with the initial job." + test: + runs-on: ubuntu-latest + needs: build + steps: + - run: echo "This job will be run after the build job." + ring01: + runs-on: ubuntu-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring02: + runs-on: macos-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring03: + runs-on: ubuntu-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring04: + runs-on: ubuntu-latest + needs: [ring01,ring02,ring03] + steps: + - run: echo "This job will be run after the ring01,ring02,ring03 jobs." + prod: + runs-on: ubuntu-latest + needs: [ring04] + steps: + - run: echo "This job will be run after the ring04 job." From ea6b84ca3bc2b999071331d54ac368bd9b3c5783 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 13:33:59 -0700 Subject: [PATCH 06/14] Update job-dependencies.yml --- .github/workflows/job-dependencies.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index 541d700c..88fff895 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -2,9 +2,9 @@ name: 02-2. Dependencies on: workflow_dispatch: - # push: - # branches: - # - main + push: + branches: + - main jobs: initial: @@ -31,10 +31,13 @@ jobs: needs: [fanout1, fanout2] steps: - run: echo "This job will run after fanout1 and fanout2 have finished." - build: - runs-on: windows-latest + build: + runs-on: ubuntu-latest + strategy: + matrix: + configuration: [debug, release] steps: - - run: echo "This job will be run in parallel with the initial job." + - run: echo "This job builds the cofiguration ${{ matrix.configuration }}." test: runs-on: ubuntu-latest needs: build From cefd49989990ae37a459ab71c8b9b279937e01c4 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 14:06:36 -0700 Subject: [PATCH 07/14] Update environments-secrets.yml --- .github/workflows/environments-secrets.yml | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index 2b128265..8c3f2485 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -1,10 +1,10 @@ name: 03-1. Environments and Secrets on: - # push: - # branches: [main] - # pull_request: - # branches: [main] + push: + branches: [main] + pull_request: + branches: [main] workflow_dispatch: # Limit the permissions of the GITHUB_TOKEN @@ -19,6 +19,23 @@ env: DEV_URL: 'https://docs.github.com/en/developers' jobs: + use-secrets: + name: Use secrets + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + steps: + - name: Hello world action with secrets + uses: actions/hello-world-javascript-action@main + with: # Set the secret as an input + who-to-greet: ${{ secrets.MY_REPO_SECRET }} + env: # Or as an environment variable + super_secret: ${{ secrets.MY_REPO_SECRET }} + - name: Echo secret is redacted in the logs + run: | + echo Env secret is ${{ secrets.MY_REPO_SECRET }} + echo Warning: GitHub automatically redacts secrets printed to the log, + echo but you should avoid printing secrets to the log intentionally. + echo ${{ secrets.MY_REPO_SECRET }} | sed 's/./& /g' use-environment-dev: name: Use DEV environment runs-on: ubuntu-latest From 4d6a0df729203b51ea74618b35ba4a496995559c Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 14:16:25 -0700 Subject: [PATCH 08/14] Update environments-secrets.yml --- .github/workflows/environments-secrets.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index 8c3f2485..e42ed6e2 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -89,12 +89,28 @@ jobs: echo Org secret is ${{ secrets.MY_ORG_SECRET }} echo Env secret is not accessible ${{ secrets.MY_ENV_SECRET }} + use-environment-uat: + name: Use UAT environment + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + needs: use-environment-test + + environment: + name: UAT + url: 'https://uat.github.com' + + steps: + - name: Step that uses the UAT environment + run: echo "Deployment to UAT..." + env: + env_secret: ${{ secrets.MY_ENV_SECRET }} + use-environment-prod: name: Use PROD environment runs-on: ubuntu-latest #if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - needs: use-environment-test + needs: use-environment-uat environment: name: PROD From e971398905afd30751c2a91f01c99d75cbd36891 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 14:30:17 -0700 Subject: [PATCH 09/14] Update environments-secrets.yml --- .github/workflows/environments-secrets.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index e42ed6e2..921a735f 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -88,8 +88,8 @@ jobs: echo Repo secret is ${{ secrets.MY_REPO_SECRET }} echo Org secret is ${{ secrets.MY_ORG_SECRET }} echo Env secret is not accessible ${{ secrets.MY_ENV_SECRET }} - - use-environment-uat: + + use-environment-uat: name: Use UAT environment runs-on: ubuntu-latest if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} From 7bcd099dd7b722ba26a3ace2f01b40a0d92db766 Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 14:45:20 -0700 Subject: [PATCH 10/14] Update environments-secrets.yml --- .github/workflows/environments-secrets.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index 921a735f..21b68e3c 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -5,7 +5,7 @@ on: branches: [main] pull_request: branches: [main] - workflow_dispatch: + workflow_dispatch: # Limit the permissions of the GITHUB_TOKEN permissions: @@ -89,23 +89,23 @@ jobs: echo Org secret is ${{ secrets.MY_ORG_SECRET }} echo Env secret is not accessible ${{ secrets.MY_ENV_SECRET }} - use-environment-uat: - name: Use UAT environment - runs-on: ubuntu-latest - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - needs: use-environment-test + use-environment-uat: + name: Use UAT environment + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + needs: use-environment-test - environment: + environment: name: UAT url: 'https://uat.github.com' - steps: + steps: - name: Step that uses the UAT environment run: echo "Deployment to UAT..." env: env_secret: ${{ secrets.MY_ENV_SECRET }} - use-environment-prod: +use-environment-prod: name: Use PROD environment runs-on: ubuntu-latest #if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} From a4d6a83f89a6adab7eb3a0585a3b02dad7f6c52e Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 14:46:58 -0700 Subject: [PATCH 11/14] Update environments-secrets.yml --- .github/workflows/environments-secrets.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index 21b68e3c..64888146 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -89,7 +89,7 @@ jobs: echo Org secret is ${{ secrets.MY_ORG_SECRET }} echo Env secret is not accessible ${{ secrets.MY_ENV_SECRET }} - use-environment-uat: + use-environment-uat: name: Use UAT environment runs-on: ubuntu-latest if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} @@ -105,7 +105,7 @@ jobs: env: env_secret: ${{ secrets.MY_ENV_SECRET }} -use-environment-prod: + use-environment-prod: name: Use PROD environment runs-on: ubuntu-latest #if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} From 3e20ad252c09158f586a2f7a72f3b1d138996a5f Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 14:52:29 -0700 Subject: [PATCH 12/14] Update job-dependencies.yml --- .github/workflows/job-dependencies.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index 88fff895..a208a4c3 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -5,7 +5,8 @@ on: push: branches: - main - + workflow_call: + jobs: initial: runs-on: ubuntu-latest From ed2a072303fa1ddd60157ec4d6021b08b5547e6e Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 14:54:16 -0700 Subject: [PATCH 13/14] Update reusable-workflow-template.yml --- .github/workflows/reusable-workflow-template.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/reusable-workflow-template.yml b/.github/workflows/reusable-workflow-template.yml index 33c7858e..5e1c11db 100644 --- a/.github/workflows/reusable-workflow-template.yml +++ b/.github/workflows/reusable-workflow-template.yml @@ -1,6 +1,8 @@ name: 04-1. Call Reusable Workflow Templates on: + push: + branches: [main] [workflow_dispatch] jobs: @@ -15,3 +17,7 @@ jobs: call_demo_workflow_job: needs: call_greet_everyone_workflow_job uses: githubabcs/gh-abcs-actions/.github/workflows/github-actions-demo.yml@main + + call_dependencies_workflow_job: + needs: call_reusable_workflow_job + uses: /gh-abcs-actions/.github/workflows/job-dependencies.yml@main From 2336be9e0e62574f5c75d4d38235c2176593cdaf Mon Sep 17 00:00:00 2001 From: Eileen Date: Tue, 29 Jul 2025 16:08:01 -0700 Subject: [PATCH 14/14] Update reusable-workflow-template.yml --- .github/workflows/reusable-workflow-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-workflow-template.yml b/.github/workflows/reusable-workflow-template.yml index 5e1c11db..f084adaa 100644 --- a/.github/workflows/reusable-workflow-template.yml +++ b/.github/workflows/reusable-workflow-template.yml @@ -3,7 +3,7 @@ name: 04-1. Call Reusable Workflow Templates on: push: branches: [main] - [workflow_dispatch] + workflow_dispatch: jobs: call_greet_everyone_workflow_job: