diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..54f5a4a --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,37 @@ +name: Build documentation + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + build: + runs-on: "ubuntu-latest" + env: + BUNDLE_WITH: docs + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + bundler-cache: true + - run: bundle exec yardoc + - uses: actions/upload-pages-artifact@v2 + with: + path: "doc/" + + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/Gemfile b/Gemfile index 9533481..62ab333 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,8 @@ source "https://rubygems.org" gemspec gem "rake", "> 12.3.2" + +group :docs, optional: true do + gem "yard" + gem "redcarpet" +end