diff --git a/.github/workflows/branch-markdown.yml b/.github/workflows/branch-markdown.yml index 9a9230a4f0..65f35d90ed 100644 --- a/.github/workflows/branch-markdown.yml +++ b/.github/workflows/branch-markdown.yml @@ -1,94 +1,94 @@ -name: Markdown - -on: pull_request - -# Allow this job to clone the repo -permissions: - contents: read - id-token: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 # Fetch all history for comparison - - - name: Load versions - run: cat .github/versions.env >> "$GITHUB_ENV" - - - name: Get changed markdown files - id: changed-files - run: | - # Fetch the base branch - git fetch origin ${{ github.base_ref }} - - # Get changed .md and .mdx files - CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRT origin/${{ github.base_ref }}...HEAD | grep -E '\.(md|mdx)$' || true) - - # Store the files - echo "files<> $GITHUB_OUTPUT - echo "$CHANGED_FILES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - # Count files - if [ -z "$CHANGED_FILES" ]; then - echo "count=0" >> $GITHUB_OUTPUT - else - echo "count=$(echo "$CHANGED_FILES" | wc -l)" >> $GITHUB_OUTPUT - fi - - - name: Install pnpm - if: steps.changed-files.outputs.count > 0 - uses: pnpm/action-setup@v6 - with: - version: ${{ env.PNPM_VERSION }} - run_install: false - - - name: Setup Node - if: steps.changed-files.outputs.count > 0 - uses: actions/setup-node@v6 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - - - name: Get pnpm store directory - if: steps.changed-files.outputs.count > 0 - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - if: steps.changed-files.outputs.count > 0 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: PNPM install - if: steps.changed-files.outputs.count > 0 - run: | - echo; echo "cd to workspace" - cd $GITHUB_WORKSPACE - echo; echo "listing" - ls - echo; echo "PNPM install" - pnpm install - - - uses: DavidAnson/markdownlint-cli2-action@v23 - if: steps.changed-files.outputs.count > 0 - with: - config: '.markdownlint.json' +name: Markdown + +on: pull_request + +# Allow this job to clone the repo +permissions: + contents: read + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + fail-fast: true + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 # Fetch all history for comparison + + - name: Load versions + run: cat .github/versions.env >> "$GITHUB_ENV" + + - name: Get changed markdown files + id: changed-files + run: | + # Fetch the base branch + git fetch origin ${{ github.base_ref }} + + # Get changed .md and .mdx files + CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRT origin/${{ github.base_ref }}...HEAD | grep -E '\.(md|mdx)$' || true) + + # Store the files + echo "files<> $GITHUB_OUTPUT + echo "$CHANGED_FILES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + # Count files + if [ -z "$CHANGED_FILES" ]; then + echo "count=0" >> $GITHUB_OUTPUT + else + echo "count=$(echo "$CHANGED_FILES" | wc -l)" >> $GITHUB_OUTPUT + fi + + - name: Install pnpm + if: steps.changed-files.outputs.count > 0 + uses: pnpm/action-setup@v6 + with: + version: ${{ env.PNPM_VERSION }} + run_install: false + + - name: Setup Node + if: steps.changed-files.outputs.count > 0 + uses: actions/setup-node@v6 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' + + - name: Get pnpm store directory + if: steps.changed-files.outputs.count > 0 + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v5 + if: steps.changed-files.outputs.count > 0 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: PNPM install + if: steps.changed-files.outputs.count > 0 + run: | + echo; echo "cd to workspace" + cd $GITHUB_WORKSPACE + echo; echo "listing" + ls + echo; echo "PNPM install" + pnpm install + + - uses: DavidAnson/markdownlint-cli2-action@v23 + if: steps.changed-files.outputs.count > 0 + with: + config: '.markdownlint.json' globs: ${{ steps.changed-files.outputs.files }} \ No newline at end of file diff --git a/.github/workflows/branch-spellcheck.yml b/.github/workflows/branch-spellcheck.yml index 05f4542256..cbd0344b09 100644 --- a/.github/workflows/branch-spellcheck.yml +++ b/.github/workflows/branch-spellcheck.yml @@ -1,64 +1,64 @@ -name: Spellcheck - -on: pull_request - -# Allow this job to clone the repo -permissions: - contents: read - id-token: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - spellcheck: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Load versions - run: cat .github/versions.env >> "$GITHUB_ENV" - - - name: Install pnpm - uses: pnpm/action-setup@v6 - with: - version: ${{ env.PNPM_VERSION }} - run_install: false - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: PNPM install - run: | - echo; echo "cd to workspace" - cd $GITHUB_WORKSPACE - echo; echo "listing" - ls - echo; echo "PNPM install" - pnpm install - - - name: Check spellings - run: | - pnpm spellcheck +name: Spellcheck + +on: pull_request + +# Allow this job to clone the repo +permissions: + contents: read + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + spellcheck: + runs-on: ubuntu-latest + strategy: + fail-fast: true + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Load versions + run: cat .github/versions.env >> "$GITHUB_ENV" + + - name: Install pnpm + uses: pnpm/action-setup@v6 + with: + version: ${{ env.PNPM_VERSION }} + run_install: false + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v5 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: PNPM install + run: | + echo; echo "cd to workspace" + cd $GITHUB_WORKSPACE + echo; echo "listing" + ls + echo; echo "PNPM install" + pnpm install + + - name: Check spellings + run: | + pnpm spellcheck diff --git a/.github/workflows/branch-validation.yml b/.github/workflows/branch-validation.yml index 29aa50783f..d458e5a86b 100644 --- a/.github/workflows/branch-validation.yml +++ b/.github/workflows/branch-validation.yml @@ -1,126 +1,126 @@ -name: Deploy to Channel - -on: pull_request - -# Allow this job to clone the repo and create a page deployment -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - branch_tests: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - env: - SHOULD_DEPLOY: ${{ secrets.OCTOPUSSERVERURL != '' || '' }} - OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }} - OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }} - OCTOPUS_SPACE: "DevOps Microsite" - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Load versions - run: cat .github/versions.env >> "$GITHUB_ENV" - - - name: Install pnpm - uses: pnpm/action-setup@v6 - with: - version: ${{ env.PNPM_VERSION }} - run_install: false - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: PNPM and Playwright install - run: | - echo; echo "cd to workspace" - cd $GITHUB_WORKSPACE - echo; echo "listing" - ls - echo; echo "NPM install" - pnpm install - - - name: Astro build and test - run: | - export NODE_OPTIONS=--max_old_space_size=4096 - pnpm dev:img - pnpm test - pnpm crawl - pnpm thin - - - name: Set Version - run: | - echo "PACKAGE_VERSION=$(date +'%Y.%m.%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV - - - name: Check output - run: | - echo; echo "cd to workspace" - cd $GITHUB_WORKSPACE - echo; echo "listing" - ls - - - name: Create a Zip package 🐙 - id: package - uses: OctopusDeploy/create-zip-package-action@v3 - with: - package_id: 'DocsMicrosite' - version: "${{ env.PACKAGE_VERSION }}-pullrequest" - base_path: "./dist" - output_folder: "./artifacts" - files: | - **/*.* - - - name: Push a package to Octopus Deploy 🐙 - uses: OctopusDeploy/push-package-action@v3.0.2 - if: ${{ env.SHOULD_DEPLOY }} - with: - packages: ${{ steps.package.outputs.package_file_path }} - - - name: Let people download package - uses: actions/upload-artifact@v4 - if: ${{ ! env.SHOULD_DEPLOY }} - with: - name: docs-microsite - path: ${{ steps.package.outputs.package_file_path }} - - - name: Push build information to Octopus Deploy 🐙 - uses: OctopusDeploy/push-build-information-action@v3 - if: ${{ env.SHOULD_DEPLOY }} - with: - version: "${{ env.PACKAGE_VERSION }}-pullrequest" - packages: ${{ steps.package.outputs.package_file_path }} - - - name: Create a release in Octopus Deploy 🐙 - id: "create_release" - uses: OctopusDeploy/create-release-action@v3 - if: ${{ env.SHOULD_DEPLOY }} - with: - project: "Docs Microsite" - package_version: "${{ env.PACKAGE_VERSION }}-pullrequest" - git_ref: ${{ github.ref }} +name: Deploy to Channel + +on: pull_request + +# Allow this job to clone the repo and create a page deployment +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + branch_tests: + runs-on: ubuntu-latest + strategy: + fail-fast: true + + env: + SHOULD_DEPLOY: ${{ secrets.OCTOPUSSERVERURL != '' || '' }} + OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }} + OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }} + OCTOPUS_SPACE: "DevOps Microsite" + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Load versions + run: cat .github/versions.env >> "$GITHUB_ENV" + + - name: Install pnpm + uses: pnpm/action-setup@v6 + with: + version: ${{ env.PNPM_VERSION }} + run_install: false + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v5 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: PNPM and Playwright install + run: | + echo; echo "cd to workspace" + cd $GITHUB_WORKSPACE + echo; echo "listing" + ls + echo; echo "NPM install" + pnpm install + + - name: Astro build and test + run: | + export NODE_OPTIONS=--max_old_space_size=4096 + pnpm dev:img + pnpm test + pnpm crawl + pnpm thin + + - name: Set Version + run: | + echo "PACKAGE_VERSION=$(date +'%Y.%m.%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV + + - name: Check output + run: | + echo; echo "cd to workspace" + cd $GITHUB_WORKSPACE + echo; echo "listing" + ls + + - name: Create a Zip package 🐙 + id: package + uses: OctopusDeploy/create-zip-package-action@v3 + with: + package_id: 'DocsMicrosite' + version: "${{ env.PACKAGE_VERSION }}-pullrequest" + base_path: "./dist" + output_folder: "./artifacts" + files: | + **/*.* + + - name: Push a package to Octopus Deploy 🐙 + uses: OctopusDeploy/push-package-action@v3.0.2 + if: ${{ env.SHOULD_DEPLOY }} + with: + packages: ${{ steps.package.outputs.package_file_path }} + + - name: Let people download package + uses: actions/upload-artifact@v4 + if: ${{ ! env.SHOULD_DEPLOY }} + with: + name: docs-microsite + path: ${{ steps.package.outputs.package_file_path }} + + - name: Push build information to Octopus Deploy 🐙 + uses: OctopusDeploy/push-build-information-action@v3 + if: ${{ env.SHOULD_DEPLOY }} + with: + version: "${{ env.PACKAGE_VERSION }}-pullrequest" + packages: ${{ steps.package.outputs.package_file_path }} + + - name: Create a release in Octopus Deploy 🐙 + id: "create_release" + uses: OctopusDeploy/create-release-action@v3 + if: ${{ env.SHOULD_DEPLOY }} + with: + project: "Docs Microsite" + package_version: "${{ env.PACKAGE_VERSION }}-pullrequest" + git_ref: ${{ github.ref }} diff --git a/.github/workflows/build-astro.yml b/.github/workflows/build-astro.yml index 8b0dce68c0..4f1bc4ad9d 100644 --- a/.github/workflows/build-astro.yml +++ b/.github/workflows/build-astro.yml @@ -1,129 +1,129 @@ -name: Deploy - -on: - workflow_dispatch: - push: - branches: [ main ] - -# Allow this job to clone the repo and create a page deployment -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build_and_deploy: - runs-on: ubuntu-latest - strategy: - fail-fast: true - - env: - SHOULD_DEPLOY: ${{ secrets.OCTOPUSSERVERURL != '' || '' }} - OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }} - OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }} - OCTOPUS_SPACE: "DevOps Microsite" - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Load versions - run: cat .github/versions.env >> "$GITHUB_ENV" - - - name: Install pnpm - uses: pnpm/action-setup@v6 - with: - version: ${{ env.PNPM_VERSION }} - run_install: false - - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: PNPM and Playwright install - run: | - echo; echo "cd to workspace" - cd $GITHUB_WORKSPACE - echo; echo "listing" - ls - echo; echo "PNPM install" - pnpm install - - - name: Astro build and test - run: | - export NODE_OPTIONS=--max_old_space_size=4096 - pnpm dev:img - pnpm test - pnpm crawl - pnpm thin - - - name: Set Version - run: | - echo "PACKAGE_VERSION=$(date +'%Y.%m.%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV - - - name: Check output - run: | - echo; echo "cd to workspace" - cd $GITHUB_WORKSPACE - echo; echo "listing" - ls - - - name: Create a Zip package 🐙 - id: package - uses: OctopusDeploy/create-zip-package-action@v3 - with: - package_id: 'DocsMicrosite' - version: "${{ env.PACKAGE_VERSION }}" - base_path: "./dist" - output_folder: "./artifacts" - files: | - **/*.* - - - name: Push a package to Octopus Deploy 🐙 - uses: OctopusDeploy/push-package-action@v3.0.2 - if: ${{ env.SHOULD_DEPLOY }} - with: - packages: ${{ steps.package.outputs.package_file_path }} - - - name: Let people download package - uses: actions/upload-artifact@v4 - if: ${{ ! env.SHOULD_DEPLOY }} - with: - name: docs-microsite - path: ${{ steps.package.outputs.package_file_path }} - - - name: Push build information to Octopus Deploy 🐙 - uses: OctopusDeploy/push-build-information-action@v3 - if: ${{ env.SHOULD_DEPLOY }} - with: - version: "${{ env.PACKAGE_VERSION }}" - packages: ${{ steps.package.outputs.package_file_path }} - - - name: Create a release in Octopus Deploy 🐙 - id: "create_release" - uses: OctopusDeploy/create-release-action@v3 - if: ${{ env.SHOULD_DEPLOY }} - with: - project: "Docs Microsite" - package_version: "${{ env.PACKAGE_VERSION }}" - git_ref: ${{ github.ref }} +name: Deploy + +on: + workflow_dispatch: + push: + branches: [ main ] + +# Allow this job to clone the repo and create a page deployment +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + strategy: + fail-fast: true + + env: + SHOULD_DEPLOY: ${{ secrets.OCTOPUSSERVERURL != '' || '' }} + OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }} + OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }} + OCTOPUS_SPACE: "DevOps Microsite" + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Load versions + run: cat .github/versions.env >> "$GITHUB_ENV" + + - name: Install pnpm + uses: pnpm/action-setup@v6 + with: + version: ${{ env.PNPM_VERSION }} + run_install: false + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v5 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: PNPM and Playwright install + run: | + echo; echo "cd to workspace" + cd $GITHUB_WORKSPACE + echo; echo "listing" + ls + echo; echo "PNPM install" + pnpm install + + - name: Astro build and test + run: | + export NODE_OPTIONS=--max_old_space_size=4096 + pnpm dev:img + pnpm test + pnpm crawl + pnpm thin + + - name: Set Version + run: | + echo "PACKAGE_VERSION=$(date +'%Y.%m.%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV + + - name: Check output + run: | + echo; echo "cd to workspace" + cd $GITHUB_WORKSPACE + echo; echo "listing" + ls + + - name: Create a Zip package 🐙 + id: package + uses: OctopusDeploy/create-zip-package-action@v3 + with: + package_id: 'DocsMicrosite' + version: "${{ env.PACKAGE_VERSION }}" + base_path: "./dist" + output_folder: "./artifacts" + files: | + **/*.* + + - name: Push a package to Octopus Deploy 🐙 + uses: OctopusDeploy/push-package-action@v3.0.2 + if: ${{ env.SHOULD_DEPLOY }} + with: + packages: ${{ steps.package.outputs.package_file_path }} + + - name: Let people download package + uses: actions/upload-artifact@v4 + if: ${{ ! env.SHOULD_DEPLOY }} + with: + name: docs-microsite + path: ${{ steps.package.outputs.package_file_path }} + + - name: Push build information to Octopus Deploy 🐙 + uses: OctopusDeploy/push-build-information-action@v3 + if: ${{ env.SHOULD_DEPLOY }} + with: + version: "${{ env.PACKAGE_VERSION }}" + packages: ${{ steps.package.outputs.package_file_path }} + + - name: Create a release in Octopus Deploy 🐙 + id: "create_release" + uses: OctopusDeploy/create-release-action@v3 + if: ${{ env.SHOULD_DEPLOY }} + with: + project: "Docs Microsite" + package_version: "${{ env.PACKAGE_VERSION }}" + git_ref: ${{ github.ref }}