Skip to content

Commit

Permalink
Adapt documentation CI flow for release
Browse files Browse the repository at this point in the history
  • Loading branch information
acogoluegnes committed Sep 28, 2023
1 parent 8651f8a commit 84ba420
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
preCommands: npm i -D @cloudflare/kv-asset-handler
command: deploy
command: deploy --name perftest-dev --route https://perftest-dev.rabbitmq.com/*
workingDirectory: 'ci/worker'
18 changes: 15 additions & 3 deletions ci/publish-documentation-to-github-pages.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
#!/usr/bin/env bash

POM_VERSION=$(cat pom.xml | grep -oPm1 '(?<=<version>)[^<]+')

# shellcheck disable=SC2102
if [[ $POM_VERSION == *[SNAPSHOT]* ]]
then
DIRECTORY="snapshot"
elif [[ $POM_VERSION == *[RCM]* ]]; then
DIRECTORY="milestone"
else
DIRECTORY="release"
fi

MESSAGE=$(git log -1 --pretty=%B)

# Concourse does shallow clones, so need the next 2 commands to have the gh-pages branch
git remote set-branches origin 'gh-pages'
git fetch -v
git checkout gh-pages
mkdir -p snapshot/htmlsingle
cp target/generated-docs/index.html snapshot/htmlsingle
mkdir -p $DIRECTORY/htmlsingle
cp target/generated-docs/index.html $DIRECTORY/htmlsingle
if [ -z "$(git status --porcelain)" ];
then
echo "Nothing to commit"
git checkout main
else
git add snapshot/
git add $DIRECTORY/
git commit -m "$MESSAGE"
git push origin gh-pages
git checkout main
Expand Down
2 changes: 0 additions & 2 deletions ci/worker/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name = "perftest-dev"
main = "src/index.ts"
compatibility_date = "2022-12-08"
routes = ["https://perftest-dev.rabbitmq.com/*"]
[site]
bucket = "./public"

0 comments on commit 84ba420

Please sign in to comment.