Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 31 additions & 11 deletions .github/workflows/deploy-gallery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
9 changes: 4 additions & 5 deletions site/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down
Loading