Skip to content

Commit

Permalink
Docs enhancements for future branches and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Feb 21, 2023
1 parent d45efd7 commit e9ad0d4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 37 deletions.
43 changes: 13 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build static sites
name: Build docs site

# Controls when the action will run. Triggers the workflow on push
# events but only for the 11.x branch
on:
push:
branches: [11.x]
branches: [11.x, 12.x]
tags: "*"

jobs:
build:
Expand All @@ -13,7 +12,7 @@ jobs:
name: Build docs and push
runs-on: ubuntu-latest
steps:
- name: Checkout 11.x
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand Down Expand Up @@ -46,8 +45,15 @@ jobs:
run: ./drush --uri=dev st
- name: Drush mk:docs
run: composer mk:docs
- name: Mike set-default
run: |
mike set-default latest
- name: Mike alias
if: ${GITHUB_REF_NAME} == '11.x'
run: mike alias latest
- name: Mike build
run: mike deploy --push 11.x dev latest
run: mike deploy --push ${GITHUB_REF_NAME}
# Build Doctum to gh-pages/api in the gh-pages branch.
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
Expand All @@ -61,34 +67,11 @@ jobs:
- name: Doctum build
run: |
rm -rf gh-pages/latest/api
composer api
## - name: Checkout CNAME+redirect+404 files
# # They got wiped and are needed.
# run: |
# cd site && git checkout -- CNAME index.html 404.html

composer api -- --only-version=${GITHUB_REF_NAME}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[CI] Add Doctum build"
repository: gh-pages
#skip_dirty_check: true
commit_user_name: "Drush Documentation Bot"
commit_user_email: "actions@github.com"

# - name: Setup Git
# run: |
# cd gh-pages && git config --local user.email "actions@github.com"
# cd gh-pages && git config --local user.name "Drush Documentation Bot"
# - name: Commit static site
# run: |
# cd gh-pages
# git add -A .
#
# if git diff-index --quiet HEAD --; then
# echo "No changes..."
# else
# git commit -m "[CI] Add Doctum build"
# fi
# - name: Git Push
# run: cd gh-pages && git push
14 changes: 7 additions & 7 deletions doctum-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
;

// Generate documentation for the main branch only
$versions = GitVersionCollection::create($dir)
// ->addFromTags('10.*') // Also generate documentation for 10.x semver releases
->add('11.x', 'Main branch');
//$versions = GitVersionCollection::create($dir)
//// ->addFromTags('10.*') // Also generate documentation for 10.x semver releases
// ->add('11.x', 'Main branch');

return new Doctum($iterator, [
// 'theme' => 'symfony',
'versions' => $versions,
'title' => 'Drush API',
'build_dir' => __DIR__.'/gh-pages/api',
// 'build_dir' => __DIR__.'/latest/api/%version%',
// 'versions' => $versions,
'title' => 'Drush API %version%',
// 'build_dir' => __DIR__.'/gh-pages/api',
'build_dir' => __DIR__.'/gh-pages/api/%version%',
'cache_dir' => __DIR__.'/.doctum-cache/%version%',
'remote_repository' => new GitHubRemoteRepository('drush-ops/drush', dirname($dir)),
'default_opened_level' => 2,
Expand Down

0 comments on commit e9ad0d4

Please sign in to comment.