Skip to content

Update dependency antora to v3.2.0-rc.2 (docs-site) #718

Update dependency antora to v3.2.0-rc.2 (docs-site)

Update dependency antora to v3.2.0-rc.2 (docs-site) #718

Workflow file for this run

name: Deploy Documentation Site
on:
push:
branches:
- docs-site
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
env:
DEPLOY: ${{ github.repository == 'junit-team/junit-framework' && github.ref == 'refs/heads/docs-site' }}
jobs:
generate_and_deploy:
name: Generate and deploy
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1
persist-credentials: false
- name: Install Graphviz
run: |
sudo apt-get update
sudo apt-get install --yes graphviz
- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .tool-versions
cache: npm
cache-dependency-path: package-lock.json
- name: Install Ruby
uses: ruby/setup-ruby@89f90524b88a01fe6e0b732220432cc6142926af # v1.313.0
with:
bundler-cache: true
- name: Install JDKs
uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0
with:
distribution: temurin
java-version: |
21
25
- name: Set up Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
cache-read-only: ${{ github.ref != 'refs/heads/docs-site' }}
- name: Download dependencies (Ruby)
run: bundle install
- name: Download dependencies (NPM)
run: npm ci
- name: Run Antora
run: npm run build
- name: Check out docs.junit.org repo
if: env.DEPLOY == 'true'
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: junit-team/docs.junit.org
path: docs-repo
fetch-depth: 1
token: ${{ secrets.JUNIT_BUILDS_GITHUB_TOKEN_DOCS_REPO }}
persist-credentials: true
- name: Copy Antora site to docs.junit.org repo
id: antora_copy
if: env.DEPLOY == 'true'
run: |
rsync --recursive --delete --checksum --archive --safe-links --human-readable --prune-empty-dirs --stats \
--exclude='_/font/roboto-*' \
--exclude-from=rsync-excludes \
build/site/ \
docs-repo
git -C docs-repo status --porcelain
git -C docs-repo status --porcelain | java RestoreUnchangedPdfs.java docs-repo | sh
git_changes=$(git -C docs-repo status --porcelain | grep --invert-match --regexp=' sitemap\.xml$' --regexp=' search-index\.js$' --regexp=' _redirects$' | wc -l)
echo "Detected $git_changes change(s)"
echo "git_changes=$git_changes" >> "$GITHUB_OUTPUT"
- name: Push to docs.junit.org repo
if: env.DEPLOY == 'true' && steps.antora_copy.outputs.git_changes > 0
working-directory: docs-repo
run: |
git config --global user.name "JUnit Team"
git config --global user.email "team@junit.org"
git add .
git commit -m "Deploy latest Antora site"
git push