Skip to content

Commit

Permalink
chore: build site using GitHub actions (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhwood authored Oct 15, 2023
1 parent edd870f commit 21a4d48
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ jobs:
matrix:
include:
- java: 8
maven: verify
- java: 11
maven: verify
- java: 17
maven: verify
- java: 21
maven: verify site
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -38,7 +34,7 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
run: xvfb-run mvn -B ${{ matrix.maven }}
run: xvfb-run mvn -B verify
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.java == '21'
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Site

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# change to macos-latest once macos-13 becomes the latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # disable shallow checkouts
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Generate site
run: xvfb-run mvn -B verify site
- name: Upload site artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload docs directory
path: target/site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ buildNumber.properties
.classpath
.vscode

# IntelliJ Idea settings
.idea

# macOS detritus
.DS_Store
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ limitations under the License.
<quiet>true</quiet>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>com.alexandriasoftware.swing.jsplitbutton</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
Expand Down

0 comments on commit 21a4d48

Please sign in to comment.