Skip to content

Commit

Permalink
Publish generated docs (#718)
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikuncar authored Feb 2, 2022
1 parent 14a0bd6 commit bbce811
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 4 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: docs

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
# Fetch all history for applying timestamps to every page
fetch-depth: 0

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true
# modify repository secret when there are problems with installing gems
cache-version: ${{ secrets.CACHE_VERSION }}

- name: Cache yardoc
uses: actions/cache@v2
with:
path: |
.yardoc
doc
key: yardoc

- name: Install
run: bundler install

- name: Build documentation
run: bundler exec rake docs

- uses: actions/upload-artifact@v2
with:
name: documentation
path: doc

publish:
runs-on: ubuntu-latest

if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs:
- build

steps:
- uses: actions/download-artifact@v2
with:
name: documentation
path: doc

- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc
commit_message: ${{ github.event.head_commit.message }}
# Write .nojekyll at the root, see:
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators
enable_jekyll: false
# Only deploy if there were changes
allow_empty_commit: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.bundle
.env
.yardoc
Gemfile.lock
doc/
failed.txt
rerun.txt
coverage/
Expand Down
11 changes: 7 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ gemspec
group :development, :test do
gem 'activesupport'
gem 'cucumber'
gem 'gem-release'
gem 'ddtrace', '>=0.51.0'
gem 'rake', '~> 13.0.1'
gem 'gem-release'
gem 'github-markup'
gem 'pry-byebug'
gem 'vcr'
gem 'rubocop'
gem 'rake', '~> 13.0.1'
gem 'redcarpet'
gem 'reek'
gem 'rspec-expectations'
gem 'rubocop'
gem 'rufo'
gem 'simplecov'
gem 'solargraph'
gem 'timecop'
gem 'vcr'
gem 'webmock'
gem 'yard'
end
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
require 'yard'

Cucumber::Rake::Task.new(:features)

YARD::Rake::YardocTask.new(:docs) do |t|
t.options += ['--title', "datadog-api-client #{DatadogAPIClient::VERSION} documentation"]
t.options += ['--markup', 'markdown']
t.options += ['--markup-provider', 'redcarpet']
t.options += ['--use-cache']
end

0 comments on commit bbce811

Please sign in to comment.