diff --git a/.github/workflows/cd-workflow.yml b/.github/workflows/cd-workflow.yml index f8a4660..b57b462 100644 --- a/.github/workflows/cd-workflow.yml +++ b/.github/workflows/cd-workflow.yml @@ -1,9 +1,8 @@ name: 07-2. CD Workflow on: - # push: - # branches: [main] - workflow_dispatch: + push: + branches: [main] env: AZURE_WEBAPP_NAME: your-app-name # set this to your application's name @@ -51,7 +50,10 @@ jobs: steps: # Add here the download-artifact step - + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: node-app - name: Deploy to Prod if: ${{ success() }} diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 6a1827e..04ce2bf 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -15,6 +15,7 @@ jobs: # CI job to run a test suite on the code base ci: name: CI + if: ${{ always() }} # We want to test across mutiple OSs, defined by our matrix runs-on: ${{ matrix.os }} needs: lint @@ -23,8 +24,8 @@ jobs: fail-fast: true matrix: # our matrix for testing across node versions and OSs - node-version: [12, 14] - os: [windows-2019, ubuntu-20.04, ubuntu-22.04] + node-version: [20, 22] + os: [macos-latest, windows-latest, ubuntu-latest] steps: - name: Checkout @@ -43,7 +44,14 @@ jobs: echo npm test # Add here the upload-artifact action - + - shell: bash + run: | + echo 'Test upload artifact' > output.log + - name: Upload output file + uses: actions/upload-artifact@v4 + with: + name: output-log-file-${{ matrix.node-version }}-${{ matrix.os }} + path: output.log # If both linting and CI succeeds we want to deploy the code to a test environment deploy-test: @@ -58,7 +66,10 @@ jobs: uses: actions/checkout@v4 # Add here the download-artifact step - + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + name: output-log-file-22-ubuntu-latest # default artifact # Placeholder - this step would be some action or run commands that deploys the code - name: Deploy to test env diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index e8540e8..d22a749 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -2,6 +2,11 @@ name: 01-1. GitHub Actions Demo on: workflow_dispatch: workflow_call: + push: + branches: + - main + paths: + - 'labs/**' jobs: Explore-GitHub-Actions: @@ -20,3 +25,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 }}.' 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." diff --git a/labs/dummyFile.txt b/labs/dummyFile.txt new file mode 100644 index 0000000..4665c3c --- /dev/null +++ b/labs/dummyFile.txt @@ -0,0 +1,3 @@ +to trigger workflow + +triggered again