Skip to content

fix: deployment of documentation #4023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/deploy-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: build main

on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version'
required: true
default: '3.0.0'
copyDocsToCurrent:
description: "Should the docs be published at https://docs.spring-boot-admin.com? Otherwise they will be accessible by version number only."
required: true
type: boolean
default: false
env:
VERSION: ${{ github.event.inputs.releaseversion }}

jobs:
deploy-documentation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Build with Maven
run: mvn -B --no-transfer-progress install -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy documentation to GitHub Pages for version ${{ github.event.inputs.releaseversion }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: spring-boot-admin-docs/target/generated-docs
target-folder: ${{ github.event.inputs.releaseversion }}
clean: true

- name: Deploy redirect for /current to /${{ github.event.inputs.releaseversion }}
uses: JamesIves/[email protected]
if: github.event.inputs.copyDocsToCurrent == 'true'
with:
branch: gh-pages
folder: spring-boot-admin-docs/target/generated-docs/current
target-folder: /current
clean: true

- name: Deploy deeplink redirect for /current/* to /${{ github.event.inputs.releaseversion }}/*
uses: JamesIves/[email protected]
if: github.event.inputs.copyDocsToCurrent == 'true'
with:
branch: gh-pages
folder: spring-boot-admin-docs/target/generated-docs/current
target-folder: /
clean: false
4 changes: 2 additions & 2 deletions spring-boot-admin-docs/src/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build:current-version-redirect": "sed \"s/@@VERSION@@/$VERSION/g\" current/index.template.html > current/index.html && sed \"s/@@VERSION@@/$VERSION/g\" current/404.template.html > current/404.html",
"build:current-version-redirect": "mkdir -p build/current/ && sed \"s/@@VERSION@@/$VERSION/g\" current/index.template.html > build/current/index.html && sed \"s/@@VERSION@@/$VERSION/g\" current/404.template.html > build/current/404.html",
"build": "docusaurus build",
"build:prod": "npm run build && npm run build:current-version-redirect && rm -rf ../../target/generated-docs && mv ./build ../../target/generated-docs"
"build:prod": "npm run build && npm run build:current-version-redirect && mv ./build ../../target/generated-docs"
},
"dependencies": {
"@docusaurus/core": "^3.6.3",
Expand Down
Loading