Skip to content

Generate Docs

Generate Docs #3

Workflow file for this run

name: Generate Docs
on:
workflow_dispatch:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: docs/playground
- name: Generate docs
run: |
cd docs/playground
bundle install
RAILS_ENV=test bundle exec rake db:reset
bundle exec rake apiwork:docs:reference
bundle exec rake docs:generate
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs/reference/ docs/playground/public/
git diff --staged --quiet || git commit -m "chore: regenerate docs"
git push