Skip to content

Commit

Permalink
Automatically update docs site
Browse files Browse the repository at this point in the history
Rather than manually updating the docs at https://mudge.name/re2,
configure GitHub Actions to do it automatically on every push to the
main branch.

Note we have to install redcarpet for YARD's Markdown support but
redcarpet doesn't compile on Alpine so we make an optional Bundler group
(see
https://bundler.io/guides/groups.html#optional-groups-and-bundlewith).
  • Loading branch information
mudge committed Nov 5, 2023
1 parent c7ef817 commit bf6c1bf
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build documentation

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
runs-on: "ubuntu-latest"
env:
BUNDLE_WITH: docs
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- run: bundle exec yardoc
- uses: actions/upload-pages-artifact@v2
with:
path: "doc/"

deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ source "https://rubygems.org"
gemspec

gem "rake", "> 12.3.2"

group :docs, optional: true do
gem "yard"
gem "redcarpet"
end

0 comments on commit bf6c1bf

Please sign in to comment.