DevOps Your Docs

A presentation at WriteTheDocs Atlantic in September 2024 in by Lorna Jane Mitchell

Slide 1

Slide 1

DevOps Your Docs Lorna Mitchell, Redocly @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 2

Slide 2

@redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 3

Slide 3

Pre-requisites @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 4

Slide 4

Content-as-code •Text-based markup enables coder tools •Separates content from presentation @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 5

Slide 5

Git Best collaboration tool on the planet. •Full change history including user and date/time •Review all changes before publishing •Safely work on many different changes at once Has a learning curve. @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 6

Slide 6

Automation @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 7

Slide 7

Automation @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 8

Slide 8

How to Automate •Pick a tool you can run anywhere •Run it locally and configure settings •Add instructions and configuration to repo •Automate for every pull request @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 9

Slide 9

Continuous integration •Check if there’s an existing integration •Or put your local command into the CI setup •Test it on a branch •Check it fails when you expect it to •Write down what was added, and why Sometimes called CI/CD Continuous Integration / Continuous Deployment @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 10

Slide 10

GitHub Actions example Lint an API description in CI. name: API linting on: [pull_request] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up node uses: actions/setup-node@v4 - name: Install Redocly CLI run: npm install -g @redocly/cli@latest - name: Run linting run: redocly lint openapi.yaml —format=github-actions @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 11

Slide 11

Automation thinking •Error or warning? •No output means everything is fine •Document the tools used and their purpose •Never ignore a failing test @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 12

Slide 12

DocOps tools •Link checking •Validation/formatting tools •Preview builds •Vale @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 13

Slide 13

Check links Either check source format, or HTML output. Check only your own links •Why? In case another site breaks. @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 14

Slide 14

Validation/Formatting Consistent whitespace and layout lowers cognitive load. Choose whether to: •validate, and report problems •format, automatically Use tools/config that work locally and in CI. @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 15

Slide 15

Preview builds Every pull request should build a preview. •makes sure that the site builds in the cloud •useful to share with stakeholders •also handy for quick reviews if needed •avoids surprises @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 16

Slide 16

Vale Quality assurance for the written word. @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 17

Slide 17

Vale Use Vale or another prose linting tool to: •check spellings (and common mis-spellings) •check product names and Proper Nouns (TM) •identify repeated words, latin terms, etc •substitutions •title/sentence case in headings •… and much more @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 18

Slide 18

Invest time and energy @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 19

Slide 19

Local platform All tools should be available locally for fast feedback. @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 20

Slide 20

People matter Docs as code is about documentarian efficiency. •Invest in the skills of the team. •Identify and share resources. •Set aside time for hands-on practice. @redocly ~ @lornajane ~ @lornajane@indieweb.social

Slide 21

Slide 21

Resources •https://lornajane.net/ •https://redocly.com/ •https://www.writethedocs.org/ •https://www.docslikecode.com/ •https://vale.sh/ @redocly ~ @lornajane ~ @lornajane@indieweb.social