Cross-repo documentation deployment from monorepo#242
Merged
Conversation
Replace the self-contained site build workflow with one that: - Is triggered only by workflow_dispatch (from the monorepo's release workflow) - Accepts version, publish_as_latest, and monorepo_tag inputs - Checks out github/copilot-sdk at the release tag for source code - Builds the Maven Site from the monorepo's java/ directory - Deploys to this repo's gh-pages branch - Detects versions from deployed directories (no tags needed in this repo) Also update index.html template links to point to the monorepo (github/copilot-sdk/tree/main/java) instead of this archived repo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reworks the documentation deployment pipeline so this repository publishes the Maven Site generated from the github/copilot-sdk monorepo (checked out at a release tag) and publishes the resulting static site content to this repo’s GitHub Pages.
Changes:
- Rewrites
deploy-site.ymlto (a) checkout the monorepo at a provided tag, (b) buildmonorepo/javaMaven Site, and (c) publish versioned docs directories (plus optional/latest/). - Updates the docs landing page template links to point to the monorepo’s
java/folder.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/deploy-site.yml | New cross-repo build + versioned site publishing logic (monorepo source, gh-pages content management, directory-based version list). |
| .github/templates/index.html | Updates repository links to the monorepo java/ location. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
.github/workflows/deploy-site.yml:201
- This job both (1) force-pushes updates to the
gh-pagesbranch and (2) runsconfigure-pages+upload-pages-artifact+deploy-pages. Those are two different GitHub Pages publishing modes; keeping both can cause duplicate deployments or failures depending on the repo’s Pages source setting, and it also makes the step naming ambiguous (two steps named "Deploy to GitHub Pages").
# 10. Push to gh-pages
- name: Deploy to GitHub Pages
run: |
cd site
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" 2>/dev/null || \
git remote add origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
git add -A
COMMIT_MSG="Deploy documentation: ${{ inputs.version }} (from ${{ inputs.monorepo_tag }})"
git diff --staged --quiet || git commit -m "$COMMIT_MSG"
git push -u origin gh-pages --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: 'site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
- Files reviewed: 2/2 changed files
- Comments generated: 4
Site content (src/site/) and a site-building POM now live in this repo. The deploy-site.yml workflow checks out the monorepo at the release tag for Java source (javadoc, JaCoCo, SpotBugs), but uses the local pom.xml and src/site/ for site structure and content. Key changes: - Add pom.xml (site-only, packaging=pom) with reporting plugins - Add src/site/ (markdown docs, site.xml, CSS, JaCoCo overlay) - Update deploy-site.yml: no longer checks out standalone into subdir; runs mvn site from repo root using local POM + monorepo source Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrites deploy-site.yml to build the Maven Site from the monorepo (github/copilot-sdk) at a release tag and deploy to this repo's gh-pages branch. Triggered by the monorepo's java-publish-maven.yml workflow.
Changes
workflow_dispatch(no more release/workflow_run triggers)github/copilot-sdkat the monorepo tag for Java sourcemonorepo/java/gh-pageswith version directory and optional/latest/symlinkSecrets required
MONOREPO_READ_TOKEN: PAT withcontents:readongithub/copilot-sdk(or default token if monorepo is readable)Companion PR
github/copilot-sdk#1524 — adds site infrastructure and deploy-site trigger job