Skip to content

Commit 2e7de2d

Browse files
committed
Create documentation generated by rdoc with GitHub Actions
1 parent 2ada858 commit 2e7de2d

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.github/workflows/gh-pages.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy RDoc site to Pages
2+
3+
on:
4+
push:
5+
branches: [ 'master' ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Setup Ruby
24+
uses: ruby/setup-ruby@32110d4e311bd8996b2a82bf2a43b714ccc91777 # v1.221.0
25+
with:
26+
ruby-version: '3.4'
27+
bundler-cache: true
28+
- name: Setup Pages
29+
id: pages
30+
uses: actions/configure-pages@v5
31+
- name: Build with RDoc
32+
# Outputs to the './_site' directory by default
33+
run: rake rdoc
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
36+
37+
deploy:
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
runs-on: ubuntu-latest
42+
needs: build
43+
steps:
44+
- name: Deploy to GitHub Pages
45+
id: deployment
46+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
/vendor/x64-mswin64*
1414
/ext/curses/Makefile
1515
.ruby-version
16+
_site

Rakefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
require "bundler"
22

33
Bundler::GemHelper.install_tasks
4+
5+
require "rdoc/task"
6+
RDoc::Task.new do |doc|
7+
doc.main = "README.md"
8+
doc.title = "Curses: A Ruby binding for curses, ncurses, and PDCurses."
9+
doc.rdoc_files = FileList.new %w[ext lib README.md BSDL COPYING]
10+
doc.rdoc_dir = "_site" # for github pages
11+
end

0 commit comments

Comments
 (0)