From 03d99dd642b58c64490e218cc22202755bd594e1 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 10:37:39 -0600 Subject: [PATCH 01/11] 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 e8540e8..92232f3 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 08d838d4d92b6fb395995bc322a8d1e36112502c Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 10:41:14 -0600 Subject: [PATCH 02/11] Update github-actions-demo.yml commit 2 --- .github/workflows/github-actions-demo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 92232f3..f01c0d3 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -7,6 +7,7 @@ on: - main paths: - 'labs/**' + jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest From 4a147dd2bc7c07335b3e87b6e28e0032f0d0b2d9 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 10:42:00 -0600 Subject: [PATCH 03/11] Update github-actions-demo.yml 3 commit3 --- .github/workflows/github-actions-demo.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index f01c0d3..3a436e1 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -6,8 +6,7 @@ on: branches: - main paths: - - 'labs/**' - + - 'labs/**' jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest From afa66f5fa441e7ac731f085efcc03a42ede943d8 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 10:44:17 -0600 Subject: [PATCH 04/11] 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 3a436e1..9504189 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 68eecad2fc0d7c9a84c97bf37eb4f0864f159c97 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 10:45:46 -0600 Subject: [PATCH 05/11] Update lab01.md --- labs/lab01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab01.md b/labs/lab01.md index 568071c..19f5ac7 100644 --- a/labs/lab01.md +++ b/labs/lab01.md @@ -8,7 +8,7 @@ References: ## 1.1 Update the workflow to trigger when a change is made to the labs folder on main branch -1. Open the workflow file [github-actions-demo.yml](/.github/workflows/github-actions-demo.yml) +1. Hey, Open the workflow file [github-actions-demo.yml](/.github/workflows/github-actions-demo.yml) 2. Edit the file and copy the following YAML content after line 4: ```YAML push: From c93a28317a8677c4d504ef319c8ef974aaf0bf0e Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 10:53:31 -0600 Subject: [PATCH 06/11] 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 e773fe0..541d700 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 0e0bc1159c7b3ede359aa3f5f832ad7c2d6be875 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 11:01:56 -0600 Subject: [PATCH 07/11] Update job-dependencies.yml --- .github/workflows/job-dependencies.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index 541d700..d6d2598 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -32,9 +32,12 @@ jobs: steps: - run: echo "This job will run after fanout1 and fanout2 have finished." build: - runs-on: windows-latest + 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 90f17fdaf953ebc43d6fc74a87624764efc0ff0d Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 18:48:42 -0600 Subject: [PATCH 08/11] Update environments-secrets.yml --- .github/workflows/environments-secrets.yml | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index 2b12826..e44b5c9 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -1,11 +1,11 @@ name: 03-1. Environments and Secrets on: - # push: - # branches: [main] - # pull_request: - # branches: [main] - workflow_dispatch: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: # Limit the permissions of the GITHUB_TOKEN permissions: @@ -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 91a472cf1ddb6011ba0c376c79db7e21d9348708 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 19:04:07 -0600 Subject: [PATCH 09/11] Update environments-secrets.yml --- .github/workflows/environments-secrets.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index e44b5c9..65c92fa 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -89,12 +89,27 @@ 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 39fd54adc415b6e21fc209232452550969834180 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 19:30:41 -0600 Subject: [PATCH 10/11] Update job-dependencies.yml --- .github/workflows/job-dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index d6d2598..af600c3 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -1,7 +1,7 @@ name: 02-2. Dependencies on: - workflow_dispatch: + workflow_call: # push: # branches: # - main From 4ab65689d5b5ca8f691776d408b44820115302e7 Mon Sep 17 00:00:00 2001 From: douglasholmberg78 Date: Tue, 17 Jun 2025 19:36:49 -0600 Subject: [PATCH 11/11] Update reusable-workflow-template.yml --- .github/workflows/reusable-workflow-template.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-workflow-template.yml b/.github/workflows/reusable-workflow-template.yml index 7e07ec7..a13cd76 100644 --- a/.github/workflows/reusable-workflow-template.yml +++ b/.github/workflows/reusable-workflow-template.yml @@ -1,7 +1,9 @@ name: 04-1. Call Reusable Workflow Templates -on: - [workflow_dispatch] +on: + push: + branches: [main] + workflow_dispatch: jobs: call_greet_everyone_workflow_job: @@ -15,3 +17,6 @@ jobs: call_demo_workflow_job: needs: call_greet_everyone_workflow_job uses: githubdevopsabcs/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