From 87d82b0b2e5d3760766badd02b2fa07915ccdfae Mon Sep 17 00:00:00 2001 From: pkbullock <8781041+pkbullock@users.noreply.github.com> Date: Sun, 15 Nov 2026 08:35:37 +0000 Subject: [PATCH 1/2] Initial plan From b43a103659dcbf7a9ad4572984cd76d1f23b561c Mon Sep 17 00:00:00 2001 From: pkbullock <8781041+pkbullock@users.noreply.github.com> Date: Sun, 15 Nov 2026 08:40:29 +0000 Subject: [PATCH 2/2] Fix gallery deployment to gh-pages Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .github/workflows/deploy-gallery.yml | 42 ++++++++++++++++++++-------- site/MIGRATION.md | 9 +++--- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy-gallery.yml b/.github/workflows/deploy-gallery.yml index 2cad70f82..7371e1b40 100644 --- a/.github/workflows/deploy-gallery.yml +++ b/.github/workflows/deploy-gallery.yml @@ -46,28 +46,48 @@ jobs: run: npx playwright install --with-deps chromium - name: Test release run: npm run test:e2e - - name: Upload Pages artifact - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 + - name: Upload built gallery + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: + name: gallery-dist-${{ github.run_id }} path: site/dist + if-no-files-found: error + retention-days: 1 deploy: needs: build + if: github.repository == 'pnp/script-samples' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + contents: write steps: - - name: Deploy GitHub Pages - id: deployment - uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Download built gallery + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + with: + name: gallery-dist-${{ github.run_id }} + path: /tmp/gallery-dist + - name: Publish static site to gh-pages + shell: bash + run: | + set -euo pipefail + publish_dir="$(mktemp -d)" + rmdir "$publish_dir" + git fetch origin gh-pages + git worktree add --detach "$publish_dir" origin/gh-pages + git -C "$publish_dir" rm -r --ignore-unmatch . + cp -a /tmp/gallery-dist/. "$publish_dir/" + touch "$publish_dir/.nojekyll" + git -C "$publish_dir" add --all + git -C "$publish_dir" -c user.name="github-actions[bot]" \ + -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \ + commit -m "Deploy gallery ${GITHUB_SHA}" + git -C "$publish_dir" push origin HEAD:gh-pages - name: Verify published commit shell: pwsh env: - SITE_URL: ${{ steps.deployment.outputs.page_url }} + SITE_URL: https://pnp.github.io/script-samples EXPECTED_COMMIT: ${{ github.sha }} run: | $ErrorActionPreference = 'Stop' diff --git a/site/MIGRATION.md b/site/MIGRATION.md index cc64e3e27..331960934 100644 --- a/site/MIGRATION.md +++ b/site/MIGRATION.md @@ -9,7 +9,7 @@ This package replaces the DocFX build with the approved Community Script Samples - Product imagery and count-ordered quick filters, combined command/alias search, tool/scenario/author filters, grid/list views, progressive results, and restored browsing context. - Contributor profiles and the supplied Credly badge. A malformed duplicate author account was corrected from other matching source records, resulting in 107 distinct accounts. - Approachable supporting guides, the sample generator, and build-time maintenance reports. -- Read-only PR checks and a separate, upstream-only GitHub Pages deployment. +- Read-only PR checks and an upstream-only GitHub Pages deployment to `gh-pages`. ## Legacy content and data repairs @@ -40,10 +40,9 @@ Redirects preserve query/fragment context and emit no tracking image. Canonical ## Owner action before deployment 1. Review the PR's catalog, generator, Astro build, link/redirect/tracker, desktop/mobile, and accessibility checks. -2. Set **Settings > Pages > Build and deployment > Source** to **GitHub Actions** when ready to cut over from the old `gh-pages` branch. -3. Allow the `github-pages` deployment environment to deploy from `main`, and merge the package. -4. Confirm the deployment workflow succeeds and verifies its commit using `/script-samples/deployment.json`. -5. Smoke-test an old sample link, filtering and browser back, a multi-tool sample, contributors, badge guidance, and the 404 page. +2. Keep **Settings > Pages > Build and deployment > Source** configured to deploy from the `gh-pages` branch. +3. Merge the package and confirm the deployment workflow verifies its commit using `/script-samples/deployment.json`. +4. Smoke-test an old sample link, filtering and browser back, a multi-tool sample, contributors, badge guidance, and the 404 page. The workflow deliberately does not deploy from personal forks. No repository settings are changed automatically by this package.