-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14a0bd6
commit bbce811
Showing
4 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |