diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 900f3e53b3..fd16745f1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml new file mode 100644 index 0000000000..ac4d4b2763 --- /dev/null +++ b/.github/workflows/docs-build.yml @@ -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 "actions@github.com" + 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