diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..3d1907d --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,40 @@ +--- +name: Deploy API docs to GitHub Pages +on: + push: + branches: ['main'] + # paths: + # - '.github/workflows/pages.yml' + # - '.yardopts' + # - 'lib/**' + # - 'Gemfile' + # - '**.txt' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + deploy_yard: + # the deploy environment (not to be confused with env) + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + name: Build and deploy YARD + steps: + - uses: kachick/deploy-yard-to-pages@v1.3.0 + id: deployment + with: + # default `doc` as default of `.yardopts` + # output-dir: 'doc' + # default version is 3.2 + ruby-version: '3.2' diff --git a/.gitignore b/.gitignore index 99938c7..98e94af 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ node_modules !/app/assets/builds/application.css /coverage + +.yardoc/ diff --git a/Gemfile b/Gemfile index 6d9eb63..f8c3937 100644 --- a/Gemfile +++ b/Gemfile @@ -100,6 +100,7 @@ group :development, :test do gem "pry", "~> 0.14" gem "rails-controller-testing" gem "rspec-rails", "5.1" + gem "yard" end gem "bcrypt_pbkdf", "~> 1.1" diff --git a/Gemfile.lock b/Gemfile.lock index 2eb7f0f..cc8b985 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -495,6 +495,7 @@ GEM will_paginate (3.3.1) xpath (3.2.0) nokogiri (~> 1.8) + yard (0.9.36) zeitwerk (2.6.13) PLATFORMS @@ -569,6 +570,7 @@ DEPENDENCIES sunspot_solr (~> 2.6) vite_rails (~> 3.0) will_paginate (~> 3.3) + yard BUNDLED WITH 2.5.6