Skip to content

Commit 95755df

Browse files
feat(docs): auto-deploy documentation to redis-field-engineering/redisctl-docs (#508)
Adds a deploy job to the docs workflow that: - Builds mdBook documentation on push to main - Pushes built HTML to redis-field-engineering/redisctl-docs gh-pages branch - Uses DOCS_DEPLOY_TOKEN for cross-org repository access Documentation will be available at: https://redis-field-engineering.github.io/redisctl-docs/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent 342e215 commit 95755df

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/docs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,40 @@ jobs:
158158
fi
159159
160160
echo "Documentation checks passed!"
161+
162+
# Deploy documentation to redis-field-engineering/redisctl-docs
163+
deploy:
164+
name: Deploy Documentation
165+
runs-on: ubuntu-latest
166+
needs: [mdbook]
167+
# Only deploy on push to main, not on PRs
168+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
169+
steps:
170+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
171+
172+
- name: Cache mdBook
173+
uses: actions/cache@v4
174+
id: mdbook-cache
175+
with:
176+
path: ~/.cargo/bin/mdbook
177+
key: ${{ runner.os }}-mdbook-0.4.40
178+
179+
- name: Install mdBook
180+
if: steps.mdbook-cache.outputs.cache-hit != 'true'
181+
run: |
182+
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz
183+
mkdir -p ~/.cargo/bin
184+
mv mdbook ~/.cargo/bin/mdbook
185+
chmod +x ~/.cargo/bin/mdbook
186+
187+
- name: Build documentation
188+
run: cd docs && mdbook build
189+
190+
- name: Deploy to redisctl-docs
191+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
192+
with:
193+
personal_token: ${{ secrets.DOCS_DEPLOY_TOKEN }}
194+
external_repository: redis-field-engineering/redisctl-docs
195+
publish_branch: gh-pages
196+
publish_dir: ./docs/book
197+
commit_message: "docs: update from redis-developer/redisctl@${{ github.sha }}"

0 commit comments

Comments
 (0)