From 2f1f500d8ca24551069261eac99363344944def3 Mon Sep 17 00:00:00 2001 From: Koorosh Aslansefat Date: Thu, 24 Sep 2026 11:20:53 +0100 Subject: [PATCH 1/2] ci: deploy docs with GitHub Pages and skip upstream services in forks --- .github/workflows/ci.yml | 4 +++ .github/workflows/docs.yml | 37 ++++++++++++++++++++------- .github/workflows/pagespeed-audit.yml | 1 + .github/workflows/publish.yml | 3 ++- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23752044..a5f72d6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,10 @@ jobs: run: uv run nox - name: Upload coverage reports to Codecov + if: >- + github.repository == 'Dependable-Intelligent-Systems-Lab/xwhy' && + (github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name == 'Dependable-Intelligent-Systems-Lab/xwhy') uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4950f020..bd6ae00c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -26,13 +26,13 @@ on: concurrency: group: documentation-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: false permissions: - contents: write + contents: read jobs: - build-and-deploy: + build-docs: if: >- github.repository == 'Dependable-Intelligent-Systems-Lab/xwhy' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') @@ -88,11 +88,30 @@ jobs: grep -q "Release history" site/release-notes/index.html ! grep -q "index.md" site/llms.txt - - name: Deploy Validated Documentation + - name: Upload GitHub Pages artifact if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' - uses: peaceiris/actions-gh-pages@v4 + uses: actions/upload-pages-artifact@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: ./site - force_orphan: true + path: ./site + + deploy: + # Repository Settings > Pages > Build and deployment > Source: GitHub Actions. + if: >- + github.repository == 'Dependable-Intelligent-Systems-Lab/xwhy' && + github.ref == 'refs/heads/main' && + github.event_name != 'pull_request' + needs: build-docs + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + + - name: Deploy validated documentation + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pagespeed-audit.yml b/.github/workflows/pagespeed-audit.yml index f26db090..8ee6cf20 100644 --- a/.github/workflows/pagespeed-audit.yml +++ b/.github/workflows/pagespeed-audit.yml @@ -18,6 +18,7 @@ permissions: jobs: mobile-audit: + if: github.repository == 'Dependable-Intelligent-Systems-Lab/xwhy' runs-on: ubuntu-latest steps: - name: Wait for GitHub Pages propagation diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 85f413e0..b0afba88 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,6 +8,7 @@ on: jobs: pypi-publish: name: Build, Publish, and Release + if: github.repository == 'Dependable-Intelligent-Systems-Lab/xwhy' runs-on: ubuntu-latest environment: @@ -44,4 +45,4 @@ jobs: uses: softprops/action-gh-release@v3 with: generate_release_notes: true - files: dist/* \ No newline at end of file + files: dist/* From 9b3e7521a4feaff605b8b768c9c9b2c4f40fb509 Mon Sep 17 00:00:00 2001 From: Koorosh Aslansefat Date: Thu, 24 Sep 2026 11:22:09 +0100 Subject: [PATCH 2/2] ci: skip production PageSpeed audit on pull requests --- .github/workflows/pagespeed-audit.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pagespeed-audit.yml b/.github/workflows/pagespeed-audit.yml index 8ee6cf20..910847a4 100644 --- a/.github/workflows/pagespeed-audit.yml +++ b/.github/workflows/pagespeed-audit.yml @@ -18,7 +18,9 @@ permissions: jobs: mobile-audit: - if: github.repository == 'Dependable-Intelligent-Systems-Lab/xwhy' + if: >- + github.repository == 'Dependable-Intelligent-Systems-Lab/xwhy' && + github.event_name != 'pull_request' runs-on: ubuntu-latest steps: - name: Wait for GitHub Pages propagation