github-pages-deploy-action
Copilot instructions4.6k starsChanged 2 years agoMITView on GitHub
This is a GitHub Action that automatically deploys your project to GitHub Pages with GitHub Actions. The action can be configured to push your production-ready code into any branch you'd like, including gh-pages and docs. It supports cross-repository deployments, works with GitHub Enterprise, and provides multiple authentication methods including SSH keys and personal access tokens. Always follow these instructions first and only fallback to additional search and context gathering if the information in these instructions is incomplete or found to…
- Installs packages
We split this copilot-instructions.md into the rules it gives an agent
18 rules. About 1 is common, 1 is distinctive, and 16 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Common: line 5
Always follow these instructions first and only fallback to additional search and context gathering if the information in these …
- Very specific: line 11
Use Node.js version from .node-version file
- Very specific: line 15
Run tests: yarn test -- takes 8 seconds.
- Very specific: line 16
Check linting: yarn lint:check -- takes 3 seconds.
- Very specific: line 17
Check formatting: yarn lint:format:check -- takes 2 seconds.
- Distinctive: line 21
ALWAYS run the bootstrapping steps first (install dependencies and build)
- Very specific: line 24
Run yarn test to ensure tests pass
- Very specific: line 25
Run yarn lint:check and yarn lint:format:check before committing
- Very specific: line 36
ALWAYS run yarn build after making changes - the action depends on compiled JavaScript in lib/
- Very specific: line 37
ALWAYS run yarn test to ensure all unit tests pass
- Very specific: line 38
ALWAYS run yarn lint:check and yarn lint:format:check or the CI will fail
- Very specific: line 51
Ensure all TypeScript compiles without errors: yarn build
- Very specific: line 52
Ensure all tests pass: yarn test
- Very specific: line 53
Ensure code follows style guidelines: yarn lint:check and yarn lint:format:check
- Very specific: line 98
All git commands go through execute() wrapper for consistent logging
- Very specific: line 111
Check TypeScript compilation errors first: yarn build
- Very specific: line 112
Run specific test files: yarn test <filename>
- Very specific: line 113
Use yarn lint to auto-fix linting issues
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Pages Deploy Action
This is a GitHub Action that automatically deploys your project to GitHub Pages with GitHub Actions. The action can be configured to push your production-ready code into any branch you'd like, including gh-pages and docs. It supports cross-repository deployments, works with GitHub Enterprise, and provides multiple authentication methods including SSH keys and personal access tokens.
Always follow these instructions first and only fallback to additional search and context gathering if the information in these instructions is incomplete or found to be in error.
Working Effectively
Bootstrap and build the repository:
- Use Node.js version from
.node-versionfile - Install Yarn globally:
npm install -g yarn - Install dependencies:
yarn install --frozen-lockfile-- takes 1-25 seconds depending on cache state - Build the project:
yarn build-- takes 9 seconds. NEVER CANCEL. Set timeout to 30+ seconds - Run tests:
yarn test-- takes 8 seconds. NEVER CANCEL. Set timeout to 30+ seconds - Check linting:
yarn lint:check-- takes 3 seconds. Set timeout to 15+ seconds - Check formatting:
yarn lint:format:check-- takes 2 seconds. Set timeout to 10+ seconds
Development workflow:
- ALWAYS run the bootstrapping steps first (install dependencies and build)
- Make code changes in the
src/directory (TypeScript source) - Build with
yarn buildto compile TypeScript to JavaScript inlib/directory - Run
yarn testto ensure tests pass - Run
yarn lint:checkandyarn lint:format:checkbefore committing
Fix linting and formatting issues:
- Auto-fix linting:
yarn lint - Auto-format code:
yarn lint:format
Validation
CRITICAL - Required validation steps:
- ALWAYS run
yarn buildafter making changes - the action depends on compiled JavaScript inlib/ - ALWAYS run
yarn testto ensure all unit tests pass - ALWAYS run
yarn lint:checkandyarn lint:format:checkor the CI will fail - NEVER CANCEL any build or test commands - they complete quickly (under 30 seconds each)
Manual testing scenarios:
Since this is a GitHub Action, full end-to-end testing requires deploying to a test repository. However, you can validate:
- Unit tests cover core functionality:
yarn testruns 59 tests with 92%+ coverage - Integration tests exist in
.github/workflows/integration.ymlbut require GitHub Actions environment - Build output in
lib/directory should match TypeScript source insrc/
Before submitting changes:
- Ensure all TypeScript compiles without errors:
yarn build - Ensure all tests pass:
yarn test - Ensure code follows style guidelines:
yarn lint:checkandyarn lint:format:check - The
lib/directory must be committed for distribution branches (not for pull requests todev)
Common Tasks
Repository structure:
src/ # TypeScript source files
├── main.ts # Entry point for GitHub Action
├── lib.ts # Main run function (can be used as module)
├── constants.ts # Configuration interfaces and constants
├── git.ts # Git operations for deployment
├── util.ts # Utility functions
├── ssh.ts # SSH key configuration
├── execute.ts # Command execution wrapper
└── worktree.ts # Git worktree operations
__tests__/ # Jest test files
lib/ # Compiled JavaScript (generated, do not edit)
integration/ # Sample files for testing deployments
.github/workflows/ # CI/CD workflowsKey files and their purposes:
action.yml- GitHub Action definition with inputs/outputspackage.json- Dependencies and npm scriptstsconfig.json- TypeScript compilation settingsjest.config.js- Test configurationeslint.config.mjs- Linting rules (ignoreslib/directory).node-version- Required Node.js version
Understanding the codebase:
- Entry Point:
src/main.tsimports and calls therun()function fromsrc/lib.ts - Core Logic:
src/lib.tscontains the main deployment logic - Git Operations:
src/git.tshandles repository initialization and deployment - Configuration:
src/constants.tsdefines interfaces for action parameters - Testing: Comprehensive Jest tests in
__tests__/directory with mocks for GitHub Actions
Common development patterns:
- Action parameters are defined in
src/constants.tsinterfaces - Error handling uses try/catch with
extractErrorMessage()utility - All git commands go through
execute()wrapper for consistent logging - SSH and token authentication are handled in separate modules
- Extensive parameter validation in
src/util.ts
CI/CD behavior:
.github/workflows/build.ymlruns on every push and PR- Linting, formatting, tests, and build must all pass
- Integration tests deploy to test repositories using various authentication methods
- Production releases include
node_modulesin distribution branches
Debugging and troubleshooting:
- Check TypeScript compilation errors first:
yarn build - Run specific test files:
yarn test <filename> - Use
yarn lintto auto-fix linting issues - The action supports debug mode via GitHub Actions debug logging
- Integration tests in CI provide real deployment validation
Important notes:
- The
lib/directory is compiled output and should not be manually edited - Distribution branches (like
v4) includenode_modulesandlib/for GitHub Actions runtime - The dev branch excludes
node_modulesandlib/from version control - SSH key support allows deployment with repository deploy keys
- Cross-repository deployment is supported with proper token permissions
Environment requirements:
- Node.js (specified in
.node-version) - Yarn package manager
- Git (for deployment operations)
- rsync (for file operations, automatically available in GitHub Actions runners)
Performance expectations:
- Fresh install: ~25 seconds for
yarn install --frozen-lockfile - Cached install: ~1 second for
yarn install --frozen-lockfile - Build: ~9 seconds for
yarn build - Tests: ~8 seconds for
yarn test - Linting: ~3 seconds for
yarn lint:check - Formatting: ~2 seconds for
yarn lint:format:check
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about JamesIves/github-pages-deploy-action
- actions/setup-node“Unable to publish to the GitHub Registry”GitHub · Mar 31, 2020 · 16 reactions
- Stack Overflow“github actions: how to access badges?”Stack Overflow · Jan 6, 2023 · 4 votes
- pulse00/Twig-Eclipse-Plugin“Use gh-pages to store P2 repository + Java 11/Eclipse 2021.06/Tycho 2.3.0”GitHub · Jun 19, 2021 · 4 reactions
- nuxt/content“Minimal Starter template no end "studio nuxt build" actions”GitHub · Sep 25, 2025 · 2 reactions
- ben-z/gh-action-mutex“Feature request: clean the repository where the action runs”GitHub · Nov 18, 2023 · 2 reactions
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on GitHub, Stack Overflow and Hacker News (54 times).
On GitHub · 50
- Mar 31, 2020Unable to publish to the GitHub Registry — actions/setup-node16 reactions · 24 comments
- Jun 19, 2021Use gh-pages to store P2 repository + Java 11/Eclipse 2021.06/Tycho 2.3.0 — pulse00/Twig-Eclipse-Plugin4 reactions · 2 comments
- Sep 25, 2025Minimal Starter template no end "studio nuxt build" actions — nuxt/content2 reactions · 9 comments
- Nov 18, 2023Feature request: clean the repository where the action runs — ben-z/gh-action-mutex2 reactions · 1 comment
- Apr 1, 2023Deploy reports success, but no Javadoc was actually published. — MathieuSoysal/Javadoc-publisher.yml2 reactions · 2 comments
45 more on GitHub
- Jan 6, 2022Feature Request: skip commit to master, build only — pengx17/logseq-publish2 reactions · 2 comments
- Oct 17, 2021add step to upload javadoc and options to github pages — soot-oss/soot2 reactions · 6 comments
- Jun 25, 2020Deploy to GitHub Pages from GitHub Actions — abarichello/godot-ci2 reactions · 3 comments
- Aug 13, 2026CI: Bump JamesIves/github-pages-deploy-action in / — pwolfe01/ladybird1 reaction
- Aug 9, 2026chore(deps): update jamesives/github-pages-deploy-action action to v4.9.0 — element-plus/element-plus1 reaction · 6 comments
- Jun 1, 2026ci: fix permissions of release workflow — Wikidata-Toolkit/Wikidata-Toolkit1 reaction · 1 comment
- May 15, 2026Chore: Pinned actions to commit hash — software-mansion/react-native-reanimated1 reaction · 1 comment
- Apr 28, 2026fix(ci): disable persist-credentials in per_commit checkout — rstackjs/rstack-ecosystem-ci1 reaction
- Feb 1, 2026chore(deps): bump the all-actions group with 2 updates — openfoodfacts/robotoff1 reaction · 1 comment
- Jan 14, 2026Migrate from Node 20 to 24 — JamesIves/github-sponsors-readme-action1 reaction
- Jan 12, 2026build(deps): bump JamesIves/github-pages-deploy-action from 4.7.6 to 4.8.0 — getsentry/sentry-java1 reaction · 1 comment
- Jan 8, 2026Migrate from node.js 20 to 24 — JamesIves/fetch-api-data-action1 reaction
- Dec 22, 2025build(deps): bump JamesIves/github-pages-deploy-action from 4.7.4 to 4.7.6 — getsentry/sentry-java1 reaction · 1 comment
- Dec 20, 2025[bug] fix CI error — caswire/caswire-website1 reaction
- Dec 20, 2025[bug] fix CI error — casvisor/casvisor-website1 reaction
- Nov 10, 2025build(deps): bump JamesIves/github-pages-deploy-action from 4.7.3 to 4.7.4 — getsentry/sentry-java1 reaction · 1 comment
- Sep 15, 2025got gh-pages deployment error on WHO/smart-trust — WorldHealthOrganization/smart-base1 reaction
- Sep 8, 2025preview branch deployments are incorrect locaiton — WorldHealthOrganization/smart-base1 reaction
- Sep 4, 2025ghpages deployment error — WorldHealthOrganization/smart-base1 reaction
- Sep 2, 2025github pages deploy fails but no error — WorldHealthOrganization/smart-base1 reaction · 1 comment
- Jan 22, 2025Add empty .nojekyll file before docs deploy — VectorInstitute/aieng-template-uv1 reaction
- Apr 6, 2024CI/CD: docs publish fails — your-tools/tsrc1 reaction · 1 comment
- Sep 28, 2023fix: update permissions to allow dashboard to write to gh-pages. — aws/s2n-tls1 reaction · 1 comment
- Aug 31, 2023Switch to automatically set up GITHUB_TOKEN — neurogenomics/rworkflows1 reaction · 6 comments
- Jul 16, 2023Update GH Actions dependencies — AntennaPod/antennapod.github.io1 reaction · 2 comments
- May 26, 2023A step missing in the setup documentation — robalexdev/marp-to-pages1 reaction · 1 comment
- Jul 10, 2020How is this related to https://github.com/JamesIves/github-pages-deploy-action — tsunematsu21/actions-publish-gh-pages1 reaction
- Oct 30, 2026build(deps): bump JamesIves/github-pages-deploy-action from 4.5.0 to 4.9.0 — max578/quorum0 reactions · 1 comment
- Oct 29, 2026build(deps): bump JamesIves/github-pages-deploy-action from 4.7.4 to 4.9.0 — lmmx/pq-glue0 reactions
- Oct 28, 2026Bump JamesIves/github-pages-deploy-action from 4.8.0 to 4.9.0 in the actions group — genius-itea/genius-itea.github.io0 reactions · 1 comment
- Oct 26, 2026:arrow_up: Bump JamesIves/github-pages-deploy-action from 4.2.5 to 4.9.0 — UltiRequiem/roman0 reactions · 1 comment
- Oct 26, 2026:arrow_up: Bump JamesIves/github-pages-deploy-action from 4.2.5 to 4.9.0 — UltiRequiem/whereiam0 reactions · 1 comment
- Oct 26, 2026:arrow_up: Bump JamesIves/github-pages-deploy-action from 4.2.5 to 4.9.0 — UltiRequiem/ofCourse0 reactions · 1 comment
- Oct 26, 2026:arrow_up: Bump JamesIves/github-pages-deploy-action from 4.2.5 to 4.9.0 — UltiRequiem/rustico0 reactions · 1 comment
- Oct 26, 2026build(deps): bump JamesIves/github-pages-deploy-action from 4.7.4 to 4.9.0 — lmmx/polars-genson0 reactions · 1 comment
- Oct 26, 2026:arrow_up: Bump JamesIves/github-pages-deploy-action from 4.2.5 to 4.9.0 — UltiRequiem/fibora0 reactions · 1 comment
- Oct 26, 2026build(deps): Bump JamesIves/github-pages-deploy-action from 4.8.0 to 4.9.0 — gtema/slides0 reactions · 1 comment
- Oct 11, 2026Sync: JamesIves/github-pages-deploy-action@0a7f3c7 — rmd-actions/github-pages-deploy-action0 reactions
- Aug 10, 2026Upstream update available: v4.9.0 — dvagactions/github-pages-deploy-action0 reactions
- Jun 8, 2026Upstream update available: v4.8.0 — dvagactions/github-pages-deploy-action0 reactions
- Mar 26, 2025Put data in a separate branch — hadley/houston-pollen0 reactions
- Mar 4, 2025Publish docs to github pages — ProRail-DataLab/openspoor0 reactions
- May 20, 2024Bump JamesIves/github-pages-deploy-action from 4.5.0 to 4.6.1 — TagnumElite/ProjectE-Integration0 reactions · 1 comment
- Dec 9, 2022Use github-pages-deploy-action — MacariaBand/macariaband.github.io0 reactions
- Sep 30, 2022Bug: Publishing github pages fails with error — level-level/Clarkson-Core0 reactions
On Stack Overflow · 3
- Jan 6, 2023github actions: how to access badges?4 votes
- Apr 4, 2021Using Github Actions Fails to Deploy Storybook to Github Pages1 vote · 1 answer
- Feb 11, 2024How Can I publish the Docs to Github pages after generating it via Dokka (Kotlin)?0 votes
On Hacker News · 1
- Sep 28, 2024JamesIves/GitHub-pages-deploy-action: File not found v4/lib/main.js1 point
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

