From 40c38d7c3dca1aa85fb0261aa9409ef2b33982a4 Mon Sep 17 00:00:00 2001 From: Tilmann Date: Fri, 15 Aug 2025 20:04:42 +0200 Subject: [PATCH 1/2] GitHub updates only --- .asf.yaml | 4 ++-- .github/workflows/build-site.yml | 2 +- .github/workflows/deploy-site.yml | 11 ++++++----- .github/workflows/recreate-site-branch.yml | 8 ++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 68bab32..42f7c91 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -32,8 +32,8 @@ github: # # set up branch protection for site publishing branch to avoid accidental deletion # force-pushes are still necessary as they are used to deploy new versions of the site - publish: - allow_force_pushes: true + #publish: + # allow_force_pushes: true notifications: commits: notifications@db.apache.org diff --git a/.github/workflows/build-site.yml b/.github/workflows/build-site.yml index 3559139..91a18e0 100644 --- a/.github/workflows/build-site.yml +++ b/.github/workflows/build-site.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 1 diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index d854066..9aa8dd7 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -18,6 +18,7 @@ on: paths: - 'src/main/asciidoc/**' - 'src/main/template/**' + - 'src/main/resources/**' - '.asf.yaml.publish' - '.htaccess' @@ -36,7 +37,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 1 @@ -52,7 +53,7 @@ jobs: id: short-sha run: | short_sha=$(git rev-parse --short=10 $GITHUB_SHA) - echo "::set-output name=SHORT_SHA::$short_sha" + echo "SHORT_SHA=$short_sha" >> "$GITHUB_OUTPUT" # Determines the author data of the HEAD commit @@ -66,8 +67,8 @@ jobs: author_email=$(git log -1 --format='%aE' HEAD) echo "Setting up author data to use for deploy commit" - git config --local user.name $author_name - git config --local user.email $author_email + git config --local user.name "$author_name" + git config --local user.email "$author_email" # Adds additional configuration files that are supposed to be included in the page deploy to the build directory @@ -152,7 +153,7 @@ jobs: has_staged_changes=true fi - echo "::set-output name=HAS_STAGED_CHANGES::$has_staged_changes" + echo "HAS_STAGED_CHANGES=$has_staged_changes" >> "$GITHUB_OUTPUT" # Publishes the build results diff --git a/.github/workflows/recreate-site-branch.yml b/.github/workflows/recreate-site-branch.yml index 8670039..a717289 100644 --- a/.github/workflows/recreate-site-branch.yml +++ b/.github/workflows/recreate-site-branch.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: main fetch-depth: 1 @@ -43,7 +43,7 @@ jobs: id: short-sha run: | short_sha=$(git rev-parse --short=10 $GITHUB_SHA) - echo "::set-output name=SHORT_SHA::$short_sha" + echo "SHORT_SHA=$short_sha" >> "$GITHUB_OUTPUT" # Determines the author data of the HEAD commit @@ -57,8 +57,8 @@ jobs: author_email=$(git log -1 --format='%aE' HEAD) echo "Setting up author data to use for deploy commit" - git config --local user.name $author_name - git config --local user.email $author_email + git config --local user.name "$author_name" + git config --local user.email "$author_email" # Creates and checks out a new orphan branch used to publish the site From e638d86de2b0bc3502de227cca46562f98593051 Mon Sep 17 00:00:00 2001 From: Tilmann Date: Fri, 15 Aug 2025 21:00:39 +0200 Subject: [PATCH 2/2] Revert to content/.htaccess --- .github/workflows/deploy-site.yml | 7 +++++-- .github/workflows/recreate-site-branch.yml | 5 +++-- .htaccess | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .htaccess diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index ed67e29..9aa8dd7 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -20,7 +20,7 @@ on: - 'src/main/template/**' - 'src/main/resources/**' - '.asf.yaml.publish' - - 'pom.xml' + - '.htaccess' jobs: @@ -78,6 +78,8 @@ jobs: if: success() run: | cp -v .asf.yaml.publish target/site/.asf.yaml + cp -v .htaccess target/site/ + - name: Check Out Site Branch if: success() @@ -104,6 +106,7 @@ jobs: if: success() run: | mv -v target/site/.asf.yaml ./ + mv -v target/site/.htaccess ./ # Moves the new site resources from the build directory to the content directory @@ -111,7 +114,7 @@ jobs: if: success() run: | mkdir -v content - mv -v target/site/* ./ + mv -v target/site/* content/ # Explicitly removes build dir # This checks whether there are any remaining resources that were not moved to the correct location diff --git a/.github/workflows/recreate-site-branch.yml b/.github/workflows/recreate-site-branch.yml index d3913c4..a717289 100644 --- a/.github/workflows/recreate-site-branch.yml +++ b/.github/workflows/recreate-site-branch.yml @@ -76,7 +76,7 @@ jobs: git reset rm .gitignore git add target/site - git add .asf.yaml.publish + git add .asf.yaml.publish .htaccess git clean -df @@ -84,7 +84,8 @@ jobs: - name: Move Content and Site Configuration if: success() run: | - git mv -v target/site/* ./ + mkdir -v content + git mv -v target/site/* content/ git mv -v .asf.yaml.publish .asf.yaml diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..8f1d4fc --- /dev/null +++ b/.htaccess @@ -0,0 +1,3 @@ +RewriteEngine On +RewriteBase / +RewriteRule ^(?!content/)(.*)$ content/$1