Skip to content

Commit

Permalink
Publish site documentation to Github Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusp committed Jan 9, 2025
1 parent 1f314db commit 3c8dc94
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/publish-site-ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish documentation

on:
workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
- name: Publish to GitHub Pages
shell: bash
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
./mvnw --batch-mode --no-transfer-progress install --file pom.xml
cd changesets-maven-plugin
../mvnw --batch-mode --no-transfer-progress clean site scm-publish:publish-scm -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions changesets-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<artifactId>changesets-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>

<distributionManagement>
<site>
<id>github</id>
<url>scm:git:https://github.com/FortnoxAB/changesets-java.git</url>
</site>
</distributionManagement>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down Expand Up @@ -87,6 +94,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.21.0</version>
<executions>
<execution>
<id>default-site</id>
<goals>
<goal>site</goal>
<goal>stage</goal>
</goals>
<phase>site</phase>
</execution>
</executions>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<scmBranch>gh-pages</scmBranch>
</configuration>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -128,4 +161,20 @@
</build>
</profile>
</profiles>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-report-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>
20 changes: 20 additions & 0 deletions changesets-maven-plugin/src/site/site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<site xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd" name="changesets-maven-plugin" xmlns="http://maven.apache.org/SITE/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bannerLeft name="changesets-maven-plugin" />
<publishDate />
<version />
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>2.0.0-M9</version>
</skin>
<body>
<menu name="Overview">
<item name="Introduction" href="index.html"/>
<item name="Goals" href="plugin-info.html"/>
</menu>
<links>
<item name="changesets-maven-plugin" href="./" />
</links>
</body>
</site>
11 changes: 10 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<maven.version>3.9.9</maven.version>
<junit-jupiter.version>5.11.3</junit-jupiter.version>
<inject-resources.version>1.0.0</inject-resources.version>
<maven-plugin-plugin.version>3.15.1</maven-plugin-plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -184,6 +185,9 @@
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.21.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
Expand All @@ -200,7 +204,7 @@
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.15.1</version>
<version>${maven-plugin-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -234,6 +238,11 @@
</pom>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-report-plugin</artifactId>
<version>${maven-plugin-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down

0 comments on commit 3c8dc94

Please sign in to comment.