Skip to content

Commit

Permalink
Merge pull request #252 from srt32/st-build-docs-in-actions
Browse files Browse the repository at this point in the history
Build docs on Actions
  • Loading branch information
manuelpuyol authored Feb 19, 2021
2 parents ab8932c + 9817622 commit f17d8cb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,6 @@ jobs:
with:
name: simplecov-resultset-rails${{matrix.rails_version}}-ruby${{matrix.ruby_version}}
path: coverage
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-build-rails-main-ruby-2.7.x-${{ hashFiles('**/Gemfile.lock') }}
- name: Generate and diff docs
run: |
gem install bundler:2.2.9
bundle config path vendor/bundle
bundle update
bundle exec rake docs:build
if [ $(git ls-files -m | grep docs\/content | wc -l) -gt 0 ] ; then
echo "======================================================================="
echo "👋! There are changes in the docs/ directory. Please run bundle exec rake docs:build and commit the diff."
echo "======================================================================="
exit 1
fi
exit 0
coverage:
needs: test
runs-on: ubuntu-latest
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Docs Build

on:
push:
branches:
- main

jobs:
runs-on: ubuntu-latest
name: Build Docs
- uses: actions/checkout@master
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-build-rails-main-ruby-2.7.x-${{ hashFiles('**/Gemfile.lock') }}
- name: Generate docs and statuses
run: |
gem install bundler:2.2.9
bundle config path vendor/bundle
bundle update
bundle exec rake docs:build
bundle exec rake statuses:dump
- name: Commit & Push Docs Data
run: |
git config --local user.email "[email protected]"
git config --local user.name "Actions Auto Build"
git add -f docs static/statuses.json
git commit -m "docs: build docs" || true
git push --force origin HEAD:refs/heads/main

1 comment on commit f17d8cb

@vercel
Copy link

@vercel vercel bot commented on f17d8cb Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.