Skip to content

Commit

Permalink
chore: publish site with GitHub Action (#252)
Browse files Browse the repository at this point in the history
* chore: publish site with GitHub Action

* remove IDE settings

* ignore IDE settings
  • Loading branch information
rhwood authored Oct 15, 2023
1 parent 68f8071 commit bb8720d
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 146 deletions.
49 changes: 0 additions & 49 deletions .classpath

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ jobs:
matrix:
include:
- java: 8
maven: verify
- java: 11
maven: verify
- java: 17
maven: verify
- java: 21
maven: verify site
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
Expand All @@ -46,9 +42,9 @@ 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@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
if: matrix.java == '17'
if: matrix.java == '21'
with:
token: ${{ secrets.CODECOV_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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 }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
egress-policy: audit

- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0 # disable shallow checkouts
- name: Set up Java
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
java-version: 21
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
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@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0
with:
# Upload docs directory
path: target/site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@9dbe3824824f8a1377b8e298bafde1a50ede43e5 # v2.0.4
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ hs_err_pid*

# macOS artifacts
.DS_Store

# IntelliJ Idea settings
.idea

# Eclipse and VSCode settings
/.project
/.classpath
/.vscode/
/.settings/
34 changes: 0 additions & 34 deletions .project

This file was deleted.

5 changes: 0 additions & 5 deletions .settings/org.eclipse.core.resources.prefs

This file was deleted.

2 changes: 0 additions & 2 deletions .settings/org.eclipse.jdt.apt.core.prefs

This file was deleted.

9 changes: 0 additions & 9 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.m2e.core.prefs

This file was deleted.

28 changes: 0 additions & 28 deletions .vscode/launch.json

This file was deleted.

9 changes: 0 additions & 9 deletions .vscode/settings.json

This file was deleted.

0 comments on commit bb8720d

Please sign in to comment.