Skip to content

Commit

Permalink
Merge pull request #280 from ydah/ghp
Browse files Browse the repository at this point in the history
Add GitHub Actions workflow for deploying Racc documentation to GitHub Pages
  • Loading branch information
flavorjones authored Jan 5, 2025
2 parents 1e36baf + 379f6f5 commit 7e98ee8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
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 Racc documentation to GitHub 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
if: ${{ github.repository == 'ruby/racc' && !startsWith(github.event_name, 'pull') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # v1.196.0
with:
ruby-version: "3.4"
bundler-cache: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Racc
run: bundle exec rake docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

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@v4
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ target
lib/java/racc/cparse-jruby.jar
lib/racc/cparse-jruby.jar
Gemfile.lock
html
_site/
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ RDoc::Task.new(:docs) do |rd|
})

title = "#{spec.name}-#{spec.version} Documentation"

rd.options << "-t #{title}"
rd.rdoc_dir = "_site"
end

def java?
Expand Down

0 comments on commit 7e98ee8

Please sign in to comment.