diff --git a/.github/workflows/00a-basic-filters.yml b/.github/workflows/00a-basic-filters.yml index 1365d7d..640e1eb 100644 --- a/.github/workflows/00a-basic-filters.yml +++ b/.github/workflows/00a-basic-filters.yml @@ -6,21 +6,22 @@ name: 00 Basic Workflow on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: + branches: - main - 'mona/octocat' - 'releases/**' # Sequence of patterns matched against refs/tags - tags: + tags: - v2 - v1.* paths: - '**.js' pull_request: - branches: [ main ] + branches: [main] + # schedule: - # * is a special character in YAML so you have to quote this string - # - cron: '30 5,17 * * *' + # * is a special character in YAML so you have to quote this string + # - cron: '30 5,17 * * *' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/01-basic-multiple-jobs.yml b/.github/workflows/01-basic-multiple-jobs.yml index 6a6c4bb..2d0460e 100644 --- a/.github/workflows/01-basic-multiple-jobs.yml +++ b/.github/workflows/01-basic-multiple-jobs.yml @@ -6,9 +6,9 @@ name: 01 Basic Workflow with Multiple Jobs on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/02-basic-multiple-jobs-needs.yml b/.github/workflows/02-basic-multiple-jobs-needs.yml index 337e066..25e3102 100644 --- a/.github/workflows/02-basic-multiple-jobs-needs.yml +++ b/.github/workflows/02-basic-multiple-jobs-needs.yml @@ -6,9 +6,9 @@ name: 02 Basic Dependencies on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -27,7 +27,7 @@ jobs: job2: # The type of runner that the job will run on runs-on: ubuntu-latest - needs: [ job1 ] + needs: [job1] # Steps represent a sequence of tasks that will be executed as part of the job steps: # Runs a single command using the runners shell @@ -36,7 +36,7 @@ jobs: job3: # The type of runner that the job will run on runs-on: ubuntu-latest - needs: [ job2 ] + needs: [job2] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/03-steps.yml b/.github/workflows/03-steps.yml index 8958819..f4f5499 100644 --- a/.github/workflows/03-steps.yml +++ b/.github/workflows/03-steps.yml @@ -6,9 +6,9 @@ name: 03 Steps on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -47,7 +47,7 @@ jobs: continue-on-error: true run: | print %ENV - shell: perl {0} + shell: perl {0} # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Reference a specific commit - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 @@ -57,4 +57,3 @@ jobs: - uses: actions/checkout@v4 # Reference a branch - uses: actions/checkout@main - diff --git a/.github/workflows/04-environment-variables.yaml b/.github/workflows/04-environment-variables.yaml index 98dc35c..b0a332e 100644 --- a/.github/workflows/04-environment-variables.yaml +++ b/.github/workflows/04-environment-variables.yaml @@ -6,9 +6,9 @@ name: 04 Variables on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/04-environment-variables2.yaml b/.github/workflows/04-environment-variables2.yaml index 392ff58..e3cc209 100644 --- a/.github/workflows/04-environment-variables2.yaml +++ b/.github/workflows/04-environment-variables2.yaml @@ -6,9 +6,9 @@ name: 04 Variable Hierarchy on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/05-conditionals.yml b/.github/workflows/05-conditionals.yml index d3af66d..26865f4 100644 --- a/.github/workflows/05-conditionals.yml +++ b/.github/workflows/05-conditionals.yml @@ -6,9 +6,9 @@ name: 05 Conditionals on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/06-expressions.yml b/.github/workflows/06-expressions.yml index 77f13d9..34de15b 100644 --- a/.github/workflows/06-expressions.yml +++ b/.github/workflows/06-expressions.yml @@ -7,9 +7,9 @@ name: 06 Expressions on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -40,4 +40,4 @@ jobs: - name: Print containsArray run: echo "$containsArray" - name: Print Presenters - run: echo "$presentersString" \ No newline at end of file + run: echo "$presentersString" diff --git a/.github/workflows/07-contexts.yml b/.github/workflows/07-contexts.yml index 615a06f..c2224fe 100644 --- a/.github/workflows/07-contexts.yml +++ b/.github/workflows/07-contexts.yml @@ -19,4 +19,4 @@ jobs: - name: Dump strategy context run: echo '${{ toJSON(strategy) }}' - name: Dump matrix context - run: echo '${{ toJSON(matrix) }}' \ No newline at end of file + run: echo '${{ toJSON(matrix) }}' diff --git a/.github/workflows/07b-vars.yml b/.github/workflows/07b-vars.yml index 36a17f9..77378fc 100644 --- a/.github/workflows/07b-vars.yml +++ b/.github/workflows/07b-vars.yml @@ -20,10 +20,9 @@ jobs: echo "organization variable : ${{ vars.ORGANIZATION_VAR }} (if I had one :) )" echo "overridden variable : ${{ vars.OVERRIDE_VAR }}" echo "variable from shell environment : $env_var" - + - name: ${{ vars.HELLO_WORLD_STEP }} if: ${{ vars.HELLO_WORLD_ENABLED == 'true' }} uses: actions/hello-world-javascript-action@main with: who-to-greet: ${{ vars.GREET_NAME }} - \ No newline at end of file diff --git a/.github/workflows/08-secrets.yml b/.github/workflows/08-secrets.yml index 7e9bb9f..01c81f4 100644 --- a/.github/workflows/08-secrets.yml +++ b/.github/workflows/08-secrets.yml @@ -6,9 +6,9 @@ name: 08 Secrets on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -49,6 +49,4 @@ jobs: - name: Parse Structured Objects run: echo "$Structured" env: - Structured: ${{fromJson(secrets.Structured).clientSecret}} - - \ No newline at end of file + Structured: ${{fromJson(secrets.Structured).clientSecret}} diff --git a/.github/workflows/09-node.js-matrix.yml b/.github/workflows/09-node.js-matrix.yml index ab61d8b..9620fec 100644 --- a/.github/workflows/09-node.js-matrix.yml +++ b/.github/workflows/09-node.js-matrix.yml @@ -6,32 +6,31 @@ name: 09 Node.js Matrix on: workflow_dispatch: push: - branches: [ main ] + branches: [main] paths: - 'node-example/**' pull_request: - branches: [ main ] + branches: [main] paths: - 'node-example/**' - + defaults: run: working-directory: node-example jobs: build-node: - strategy: matrix: node-version: [12.x, 14.x, 16.x] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build --if-present - - run: npm test + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test diff --git a/.github/workflows/10-dotnet.yml b/.github/workflows/10-dotnet.yml index 2ac4718..075145a 100644 --- a/.github/workflows/10-dotnet.yml +++ b/.github/workflows/10-dotnet.yml @@ -3,12 +3,12 @@ name: 10 .NET on: workflow_dispatch: push: - branches: [ main ] + branches: [main] paths: - '!**' - 'dotnet-sample/**' pull_request: - branches: [ main ] + branches: [main] paths: - '!**' - 'dotnet-sample/**' @@ -23,44 +23,43 @@ defaults: jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - name: Set up dependency caching for faster builds - uses: actions/cache@v3 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - restore-keys: | - ${{ runner.os }}-nuget- + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Set up dependency caching for faster builds + uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: | + ${{ runner.os }}-nuget- - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --configuration Release --no-restore - - name: Test - run: dotnet test --no-build --verbosity normal + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal - - name: dotnet publish - run: dotnet publish -c Release -o ./webapp + - name: dotnet publish + run: dotnet publish -c Release -o ./webapp - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v3 - with: - name: webapp - path: ./dotnet-sample/webapp + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: webapp + path: ./dotnet-sample/webapp - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v3 - with: - name: iac - path: ./dotnet-sample/iac + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: iac + path: ./dotnet-sample/iac deploy-webapp: needs: [build] @@ -68,39 +67,38 @@ jobs: runs-on: ubuntu-latest steps: # Checkout code - - name: Download IaC - uses: actions/download-artifact@v3 - with: - name: iac - path: iac + - name: Download IaC + uses: actions/download-artifact@v3 + with: + name: iac + path: iac - # Log into Azure - - uses: azure/login@v1 - name: Sign in to Azure - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + # Log into Azure + - uses: azure/login@v1 + name: Sign in to Azure + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - # Deploy Bicep file - - name: deploy - id: deploy - uses: azure/arm-deploy@v1 - with: - resourceGroupName: ${{ secrets.AZURE_RG }} - template: ./iac/main.bicep - parameters: webAppName=${{ secrets.AZURE_APP_NAME }} - failOnStdErr: false - - - name: Download App - uses: actions/download-artifact@v3 - with: - name: webapp - path: webapp + # Deploy Bicep file + - name: deploy + id: deploy + uses: azure/arm-deploy@v1 + with: + resourceGroupName: ${{ secrets.AZURE_RG }} + template: ./iac/main.bicep + parameters: webAppName=${{ secrets.AZURE_APP_NAME }} + failOnStdErr: false - - name: 'Run Azure webapp deploy action using publish profile credentials' - uses: azure/webapps-deploy@v2 - with: - app-name: ${{ steps.deploy.outputs.webAppName }} # Replace with your app name - package: 'webapp' + - name: Download App + uses: actions/download-artifact@v3 + with: + name: webapp + path: webapp + - name: 'Run Azure webapp deploy action using publish profile credentials' + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ steps.deploy.outputs.webAppName }} # Replace with your app name + package: 'webapp' diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7ddbb43..4afad3a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,36 +3,35 @@ name: Docker Image CI on: workflow_dispatch: push: - branches: [ main ] + branches: [main] paths: - 'container-example/**' pull_request: - branches: [ main ] + branches: [main] paths: - 'container-example/**' - + defaults: run: working-directory: containers-example jobs: - build: environment: docker runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: container-example - push: true - tags: | - ${{ secrets.DOCKER_USERNAME }}/static-site:latest - ${{ secrets.DOCKER_USERNAME }}/static-site:${{ github.sha }} + - uses: actions/checkout@v4 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: container-example + push: true + tags: | + ${{ secrets.DOCKER_USERNAME }}/static-site:latest + ${{ secrets.DOCKER_USERNAME }}/static-site:${{ github.sha }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 49c5c35..8b52047 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,8 +8,8 @@ jobs: name: Lint code runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Lint code - run: | - az bicep build --file bicep/main.bicep \ No newline at end of file + - name: Lint code + run: | + az bicep build --file bicep/main.bicep diff --git a/.github/workflows/marp-pages.yml b/.github/workflows/marp-pages.yml index eda7651..3bc7495 100644 --- a/.github/workflows/marp-pages.yml +++ b/.github/workflows/marp-pages.yml @@ -3,7 +3,7 @@ name: Deploy marp site to Pages on: # Runs on pushes targeting the default branch push: - branches: ["main"] + branches: ['main'] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -17,7 +17,7 @@ permissions: # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: - group: "pages" + group: 'pages' cancel-in-progress: false jobs: @@ -30,7 +30,7 @@ jobs: run: mkdir build && cp -R slides/img build/img && cp -R slides/themes build/themes - name: Marp Build (README) - uses: docker://marpteam/marp-cli:v2.5.0 + uses: docker://marpteam/marp-cli:latest with: args: --theme-set slides/themes -o build/index.html --html -- slides/Slides.md env: @@ -44,4 +44,4 @@ jobs: path: 'build' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index 7293475..dbf282b 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -1,7 +1,7 @@ name: pr-closed concurrency: ${{ github.event.number }} -on: +on: pull_request: types: [closed] @@ -24,8 +24,8 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - uses: Azure/cli@v1 name: Delete resource group - with: + with: inlineScript: | az group delete \ --name ${{ env.resourceGroupName }} \ - --yes \ No newline at end of file + --yes diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index f4d20b3..06d06ce 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -15,7 +15,7 @@ jobs: lint: uses: ./.github/workflows/lint.yml - deploy: + deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -27,7 +27,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - uses: Azure/cli@v1 name: Create resource group - with: + with: inlineScript: | az group create \ --name ${{ env.resourceGroupName }} \ @@ -44,4 +44,4 @@ jobs: environmentType=Test - name: Show website hostname run: | - echo "Access the website at this address: https://${{ steps.deploy.outputs.appServiceAppHostName }}" \ No newline at end of file + echo "Access the website at this address: https://${{ steps.deploy.outputs.appServiceAppHostName }}" diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index cb4d5d0..9e14997 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -8,9 +8,9 @@ name: Lint Code Base on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: run-lint: runs-on: ubuntu-latest