mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-31 10:08:47 -04:00
fix(docs): compile Jekyll docs site and add root redirect in CI (#5526)
This commit is contained in:
21
.github/workflows/docs-deploy.yml
vendored
21
.github/workflows/docs-deploy.yml
vendored
@@ -48,18 +48,33 @@ jobs:
|
||||
- name: Build Dokka HTML documentation
|
||||
run: ./gradlew dokkaGeneratePublicationHtml --no-configuration-cache
|
||||
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '4.0.4'
|
||||
bundler-cache: true
|
||||
working-directory: docs
|
||||
|
||||
- name: Generate Docs Site
|
||||
run: ./gradlew generateDocsBundle validateDocsBundle publishDocsSite -Pdocs.channel=root -Pci=true
|
||||
|
||||
- name: Compile Jekyll Docs Site
|
||||
run: |
|
||||
BUNDLE_GEMFILE=docs/Gemfile bundle exec jekyll build \
|
||||
--source build/_site \
|
||||
--destination build/jekyll_site \
|
||||
--baseurl /${{ github.event.repository.name }}
|
||||
touch build/jekyll_site/.nojekyll
|
||||
|
||||
- name: Assemble Pages artifact
|
||||
run: |
|
||||
# Copy Dokka output into _site/api/
|
||||
cp -r build/dokka/html build/_site/api
|
||||
# Copy Dokka output into compiled jekyll_site/api/
|
||||
cp -r build/dokka/html build/jekyll_site/api
|
||||
|
||||
- name: Upload Pages Artifact
|
||||
uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
path: build/_site/
|
||||
path: build/jekyll_site/
|
||||
|
||||
deploy:
|
||||
if: github.repository == 'meshtastic/Meshtastic-Android'
|
||||
|
||||
45
.github/workflows/docs-release.yml
vendored
45
.github/workflows/docs-release.yml
vendored
@@ -38,6 +38,13 @@ jobs:
|
||||
with:
|
||||
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '4.0.4'
|
||||
bundler-cache: true
|
||||
working-directory: docs
|
||||
|
||||
# Build root docs site (/ on Pages)
|
||||
- name: Build Root Docs Site
|
||||
run: ./gradlew generateDocsBundle publishDocsSite -Pdocs.channel=root -Pci=true
|
||||
@@ -50,17 +57,45 @@ jobs:
|
||||
- name: Build Dokka HTML documentation
|
||||
run: ./gradlew dokkaGeneratePublicationHtml --no-configuration-cache
|
||||
|
||||
- name: Compile Jekyll Sites
|
||||
run: |
|
||||
# Build versioned Jekyll site
|
||||
BUNDLE_GEMFILE=docs/Gemfile bundle exec jekyll build \
|
||||
--source build/_site/v${{ steps.version.outputs.version }} \
|
||||
--destination build/jekyll_release \
|
||||
--baseurl /${{ github.event.repository.name }}/v${{ steps.version.outputs.version }}
|
||||
|
||||
# Move versioned source folder out of root source folder to avoid nested build issues
|
||||
mv build/_site/v${{ steps.version.outputs.version }} build/v_temp
|
||||
|
||||
# Build root Jekyll site
|
||||
BUNDLE_GEMFILE=docs/Gemfile bundle exec jekyll build \
|
||||
--source build/_site \
|
||||
--destination build/jekyll_root \
|
||||
--baseurl /${{ github.event.repository.name }}
|
||||
|
||||
- name: Assemble Pages artifact
|
||||
run: |
|
||||
# Root site is already at build/_site/ from the root channel build.
|
||||
# Versioned docs are at build/_site/v{version}/ from the release channel build.
|
||||
# Add Dokka at /api/
|
||||
cp -r build/dokka/html build/_site/api
|
||||
# Create final site directory
|
||||
mkdir -p build/final_site
|
||||
|
||||
# Copy root compiled site
|
||||
cp -r build/jekyll_root/* build/final_site/
|
||||
|
||||
# Copy release compiled site to vX.Y.Z/
|
||||
mkdir -p build/final_site/v${{ steps.version.outputs.version }}
|
||||
cp -r build/jekyll_release/* build/final_site/v${{ steps.version.outputs.version }}/
|
||||
|
||||
# Copy Dokka output into final_site/api/
|
||||
cp -r build/dokka/html build/final_site/api
|
||||
|
||||
# Disable GitHub Pages' own Jekyll build
|
||||
touch build/final_site/.nojekyll
|
||||
|
||||
- name: Upload Pages Artifact
|
||||
uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
path: build/_site/
|
||||
path: build/final_site/
|
||||
|
||||
deploy:
|
||||
if: github.repository == 'meshtastic/Meshtastic-Android'
|
||||
|
||||
Reference in New Issue
Block a user