Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub Pages Action for generating rdoc page #477

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy RDoc site to Pages

on:
push:
branches: [ 'master' ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@92aece5fc9c784ab66851c1e702b1bd5885a51f2 # v1.139.0
with:
ruby-version: '3.2'
bundler-cache: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with RDoc
# Outputs to the './_site' directory by default
run: bundle exec rake rdoc
- name: Upload artifact
uses: actions/upload-pages-artifact@v1

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
11 changes: 1 addition & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ RDoc::Task.new do |doc|
doc.main = "README.rdoc"
doc.title = "Rake -- Ruby Make"
doc.rdoc_files = FileList.new %w[lib MIT-LICENSE doc/**/*.rdoc *.rdoc]
doc.rdoc_dir = "html"
end

task ghpages: :rdoc do
%x[git checkout gh-pages]
require "fileutils"
FileUtils.rm_rf "/tmp/html"
FileUtils.mv "html", "/tmp"
FileUtils.rm_rf "*"
FileUtils.cp_r Dir.glob("/tmp/html/*"), "."
doc.rdoc_dir = "_site" # for github pages
end

task default: :test