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.
  • Loading branch information
mudge committed Nov 5, 2023
1 parent c7ef817 commit 6e78512
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build documentation

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
runs-on: "ubuntu-latest"
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
2 changes: 2 additions & 0 deletions re2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ Gem::Specification.new do |s|
s.add_development_dependency("rake-compiler", "~> 1.2.1")
s.add_development_dependency("rake-compiler-dock", "~> 1.3.0")
s.add_development_dependency("rspec", "~> 3.2")
s.add_development_dependency("yard")
s.add_development_dependency("redcarpet")
s.add_runtime_dependency("mini_portile2", "~> 2.8.5") # keep version in sync with extconf.rb
end

0 comments on commit 6e78512

Please sign in to comment.