From 837514b3e23726f878986cd654246946126d2c1e Mon Sep 17 00:00:00 2001 From: Reza Rahman <13340707+rezrah@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:12:16 +0100 Subject: [PATCH 1/3] add preview deployments --- .github/workflows/build-website.yml | 47 ----------- .github/workflows/deploy-website-preview.yml | 85 ++++++++++++++++++++ 2 files changed, 85 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/build-website.yml create mode 100644 .github/workflows/deploy-website-preview.yml diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml deleted file mode 100644 index ba0a0f0d34..0000000000 --- a/.github/workflows/build-website.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Build Website - -on: - pull_request: - branches: [main] - paths: - - "website/**" - - "agents/**" - - "skills/**" - - "plugins/**" - - "instructions/**" - - "hooks/**" - - "workflows/**" - - "extensions/**" - - "cookbook/**" - - "eng/**" - - ".all-contributorsrc" - - "package.json" - - "package-lock.json" - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - with: - fetch-depth: 0 # Full history needed for git-based last updated dates - - - name: Setup Node.js - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version: "22" - cache: "npm" - - - name: Install root dependencies - run: npm ci - - - name: Install website dependencies - run: npm ci - working-directory: ./website - - - name: Build Astro site - run: npm run website:build diff --git a/.github/workflows/deploy-website-preview.yml b/.github/workflows/deploy-website-preview.yml new file mode 100644 index 0000000000..9dc7324258 --- /dev/null +++ b/.github/workflows/deploy-website-preview.yml @@ -0,0 +1,85 @@ +# GitHub Pages preview deployment workflow +# Builds the Astro website and deploys a preview for pull requests + +name: Deploy preview website to GitHub Pages + +on: + pull_request: + branches: [main] + paths: + - "website/**" + - "agents/**" + - "skills/**" + - "plugins/**" + - "instructions/**" + - "hooks/**" + - "workflows/**" + - "extensions/**" + - "cookbook/**" + - "eng/**" + - ".all-contributorsrc" + - "package.json" + - "package-lock.json" + +concurrency: + group: pages-preview-${{ github.ref }} + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + permissions: + checks: read + contents: read + pages: write + pull-requests: read + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + fetch-depth: 0 # Full history needed for git-based last updated dates + + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: "22" + cache: "npm" + + - name: Install root dependencies + run: npm ci + + - name: Install website dependencies + run: npm ci + working-directory: ./website + + - name: Build Astro site + run: npm run website:build + + - name: Setup Pages + if: github.event.pull_request.head.repo.full_name == github.repository # Not a fork + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 + + - name: Upload artifact + if: github.event.pull_request.head.repo.full_name == github.repository # Not a fork + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + with: + path: "./website/dist" + + # Deployment job + deploy: + if: github.event.pull_request.head.repo.full_name == github.repository # Not a fork + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + permissions: + pages: write + id-token: write + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 + with: + preview: true From f837c3f90a0777df1d20bb0ec399b9a5ea7ab16e Mon Sep 17 00:00:00 2001 From: Reza Rahman <13340707+rezrah@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:22:19 +0100 Subject: [PATCH 2/3] remove workflow from paths --- .github/workflows/deploy-website-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-website-preview.yml b/.github/workflows/deploy-website-preview.yml index 9dc7324258..191f478da1 100644 --- a/.github/workflows/deploy-website-preview.yml +++ b/.github/workflows/deploy-website-preview.yml @@ -14,6 +14,7 @@ on: - "instructions/**" - "hooks/**" - "workflows/**" + - ".github/workflows/**" - "extensions/**" - "cookbook/**" - "eng/**" From e36871476fccd27761605399a3ae3b748d297124 Mon Sep 17 00:00:00 2001 From: Reza Rahman <13340707+rezrah@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:25:31 +0100 Subject: [PATCH 3/3] reduce perm for build --- .github/workflows/deploy-website-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-website-preview.yml b/.github/workflows/deploy-website-preview.yml index 191f478da1..c0a59a5eb4 100644 --- a/.github/workflows/deploy-website-preview.yml +++ b/.github/workflows/deploy-website-preview.yml @@ -33,7 +33,7 @@ jobs: permissions: checks: read contents: read - pages: write + pages: read pull-requests: read steps: - name: Checkout