Skip to content

Commit

Permalink
Moved docs to Docusarus.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Jan 8, 2025
1 parent 4b8ada3 commit a212897
Show file tree
Hide file tree
Showing 29 changed files with 21,615 additions and 284 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Publish documentation to GitHub Pages
name: Release docs

on:
push:
tags:
- '*'
branches:
- main

permissions:
contents: read
Expand All @@ -17,10 +15,10 @@ concurrency:
cancel-in-progress: true

jobs:
publish-docs:
release-docs:
environment:
name: github-pages
url: ${{ steps.pages.outputs.page_url }}
url: ${{ steps.pages.outputs.base_url }}

runs-on: ubuntu-latest

Expand All @@ -31,29 +29,28 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: 0
working-directory: '${{ github.workspace }}/docs'
fetch-depth: 0

- name: Setup GitHub pages
uses: actions/configure-pages@v5
id: pages
- name: Setup Node.js
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
working-directory: '${{ github.workspace }}/docs'

- name: Build documentation site
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
run: npm run build
working-directory: '${{ github.workspace }}/docs'
env:
JEKYLL_ENV: production

- name: Setup GitHub pages
uses: actions/configure-pages@v5
id: pages

- name: Upload documentation site
uses: actions/upload-pages-artifact@v3
with:
path: "docs/_site/"
path: "docs/build"

- name: Deploy documentation site
uses: actions/deploy-pages@v4
50 changes: 50 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test Docs

on:
push:
branches:
- main
pull_request:
branches:
- 'main'
- 'feature/**'

jobs:
test-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
working-directory: '${{ github.workspace }}/docs'

- name: Build documentation site
run: npm run build
working-directory: '${{ github.workspace }}/docs'

- name: Run tests
run: npm run test
working-directory: '${{ github.workspace }}/docs'

- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
publish-dir: 'docs/build'
production-branch: main
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
timeout-minutes: 1
25 changes: 19 additions & 6 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata
.bundle/
vendor/
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
5 changes: 0 additions & 5 deletions docs/Gemfile

This file was deleted.

103 changes: 0 additions & 103 deletions docs/Gemfile.lock

This file was deleted.

23 changes: 19 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# BATS helpers documentation

Copied from https://github.com/just-the-docs/just-the-docs-template
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

## Building locally
```shell
npm ci
```

bundle install
### Local Development

bundle exec jekyll serve
```shell
npm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```shell
npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
69 changes: 0 additions & 69 deletions docs/_config.yml

This file was deleted.

36 changes: 0 additions & 36 deletions docs/_includes/components/aux_nav.html

This file was deleted.

3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Loading

0 comments on commit a212897

Please sign in to comment.