Skip to content

Commit

Permalink
Merge pull request #1539 from LowerRockLabs/v3-DoctumConfiguration
Browse files Browse the repository at this point in the history
V3 doctum configuration
  • Loading branch information
lrljoe authored Nov 5, 2023
2 parents f73b59e + 1c134a2 commit 435f5c4
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 18 deletions.
37 changes: 19 additions & 18 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.phpunit.cache export-ignore
/build export-ignore
/database/database.sqlite export-ignore
/database/sqlite.database. export-ignore
/docs export-ignore
/resources/views/tests export-ignore
/tests export-ignore
/vendor export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.cache export-ignore
/.php-cs-fixer.php export-ignore
/phpunit.result.cache export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/.github export-ignore
/.phpunit.cache export-ignore
/build export-ignore
/database/database.sqlite export-ignore
/database/sqlite.database. export-ignore
/doctum export-ignore
/docs export-ignore
/resources/views/tests export-ignore
/tests export-ignore
/vendor export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.cache export-ignore
/.php-cs-fixer.php export-ignore
/phpunit.result.cache export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/codecov.yml export-ignore
Expand Down
110 changes: 110 additions & 0 deletions .github/workflows/build-doctum-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: build-doctum-docs

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

name: Update-DoctumDocs-Branch

steps:
- uses: actions/checkout@v3
with:
# The branch, tag or SHA to checkout. When checking out the repository that
# triggered a workflow, this defaults to the reference or SHA for that event.
# Otherwise, uses the default branch.
ref: 'master'

- name: build doctum docs
uses: sudo-bot/action-doctum@latest
with:
config-file: doctum-config.php
# parse, render or update
method: "update"
# (optional) defaults to '--output-format=github --no-ansi --no-progress -v'
cli-args: "--output-format=github --no-ansi --no-progress -v"

- name: Remove GitHub Specific Issues
run: |
rm .editorconfig
rm .gitattributes
rm .gitignore
- name: Remove Package Specific Items
run: |
rm composer.json
rm codecov.yml
rm coverage.xml
rm doctum-config.php
rm phpstan.neon
rm phpunit.xml.dist
rm psalm.xml.dist
rm CHANGELOG.md
rm CONTRIBUTORS.md
rm LICENSE.md
rm README.md
- name: Remove Package Directories
run: |
rm -rf .github
rm -rf build/cache
rm -rf cache
rm -rf config
rm -rf docs
rm -rf database
rm -rf resources
rm -rf public
rm -rf src
rm -rf tests
- name: Move Doctum Docs
run: |
mv build docs
git add docs/*
- name: Restore Readme
run: |
echo "This branch is used solely to store Doctum Documents)" >> README.md
- uses: stefanzweifel/git-auto-commit-action@v4
with:
# Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes"
commit_message: Automated Change

# Optional. Options used by `git-commit`.
# See https://git-scm.com/docs/git-commit#_options
commit_options: '--no-verify --signoff'

# Optional. Option used by `git-status` to determine if the repository is
# dirty. See https://git-scm.com/docs/git-status#_options
status_options: '--untracked-files=yes'

# Optional. Local and remote branch name where commit is going to be pushed
# to. Defaults to the current branch.
# You might need to set `create_branch: true` if the branch does not exist.
branch: doctum-docs

# Optional. Options used by `git-add`.
# See https://git-scm.com/docs/git-add#_options
add_options: '-u'

# Optional. Disable dirty check and always try to create a commit and push
skip_dirty_check: true

# Optional. Skip internal call to `git fetch`
skip_fetch: true

# Optional. Skip internal call to `git checkout`
skip_checkout: true

# Optional. Options used by `git-push`.
# See https://git-scm.com/docs/git-push#_options
push_options: '--force'

# Optional commit user and author settings
commit_user_name: Doctum Docs Bot # defaults to "github-actions[bot]"
commit_user_email: [email protected] # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: Doctum Docs Bot <[email protected]> # defaults to author of the commit that triggered the run
create_branch: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ phpunit.xml.dist.dev
.env
phpunit.xml.bak
phpstan.txt
doctum
33 changes: 33 additions & 0 deletions doctum-config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Doctum\Doctum;
use Doctum\RemoteRepository\GitHubRemoteRepository;
use Doctum\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;

$dir = './src';

$iterator = Finder::create()
->files()
->name('*.php')
->exclude('Resources')
->exclude('Tests')
->in($dir);

// generate documentation for all v2.0.* tags, the 2.0 branch, and the main one
$versions = GitVersionCollection::create($dir)
// In a non case-sensitive way, tags containing "PR", "RC", "BETA" and "ALPHA" will be filtered out
// To change this, use: `$versions->setFilter(static function (string $version): bool { // ... });`
->add('master', '3.x branch')
->add('v2-master', '2.x branch')
->add('v1', '1.x branch');

return new Doctum($iterator, [
'versions' => $versions,
'title' => 'Rappasoft - Laravel Livewire Tables',
'build_dir' => __DIR__.'/build/%version%',
'cache_dir' => __DIR__.'/cache/%version%',
'source_dir' => dirname($dir).'/',
'remote_repository' => new GitHubRemoteRepository('rappasoft/laravel-livewire-tables', dirname($dir)),
'default_opened_level' => 2, // optional, 2 is the default value
]);

0 comments on commit 435f5c4

Please sign in to comment.