Conversation
Replace concurrent gh-pages git pushes with the recommended Actions Pages pattern: build jobs run in parallel and upload artifacts, a single deploy job downloads all artifacts and publishes once via actions/configure-pages + actions/upload-pages-artifact + actions/deploy-pages. - schedule.yaml: set permissions (pages:write, id-token:write, contents:read), add concurrency group, pass publish:false to build jobs, add single deploy job - build.yaml: update permissions, replace git-push publish job with deploy-pages-based publish (for standalone workflow_dispatch use) Agent-Logs-Url: https://github.com/m-aciek/python-docs-offline/sessions/ef8d01ff-dbf0-4912-b4ea-425561a6b349 Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update GitHub Actions workflow for documentation publishing
Switch scheduled Pages deployment from concurrent git pushes to single artifact-based deploy
Apr 8, 2026
Agent-Logs-Url: https://github.com/m-aciek/python-docs-offline/sessions/3a039646-7f76-4cf9-b6b4-cb675827b67a Co-authored-by: m-aciek <9288014+m-aciek@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.
publishtofalseonpushby addinggithub.event_name != 'push'to thedeployjob'sifconditionOriginal prompt
Create a pull request in repository
m-aciek/python-docs-offlinethat updates the scheduled GitHub Actions workflow responsible for generating and publishing documentation/PDF builds so that it avoids concurrent pushes/commit conflicts togh-pages.Implement the recommended GitHub Pages custom workflow pattern:
deployjob runs after all build jobs (needs:), downloads/merges artifacts into one publish directory, and publishes to GitHub Pages using:actions/configure-pagesactions/upload-pages-artifactactions/deploy-pagesRequirements:
git pushtogh-pagesfrom multiple jobs.workflow_dispatchif currently present.permissionsfor Pages deployment (pages: write,id-token: write, and keepcontents: readunless additional permissions are strictly needed).concurrencygroup appropriate for Pages deployments so that overlapping scheduled runs don’t deploy simultaneously (e.g., group per branch/ref)._site/orsite/as appropriate based on existing workflow).Deliverables in the PR:
.github/workflows/implementing the above.Notes:
gh-pages, replace that mechanism withdeploy-pages.Repository: m-aciek/python-docs-offline
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: I'd like to commit generated files in concurrent GH workflow jobs to gh-pages. How to do that avoiding conflicts when pushing?
Assistant: To avoid push conflicts, don’t have multiple concurrent jobs commit/push to
gh-pages. Instead: build in parallel → upload artifacts → deploy once in a single job. This is the approach GitHub recommends for Pages with custom workflows (it removes Git race conditions entirely). See: Using custom workflows with GitHub Pages.Recommended pattern (no
git pushtogh-pagesat all)1) Build jobs run concurrently and upload artifacts
Use a matrix to generate outputs in parallel, and upload each output as an artifact (name them uniquely per matrix entry).
2) One deploy job runs after all builds
A single
deployjob:actions/deploy-pagesGitHub documents the
upload-pages-artifact+deploy-pagesflow here: Using custom workflows with GitHub Pages and the overall “publish with Actions” setup here: Configuring a publishing source for your GitHub Pages site.Minimal workflow sketch