Skip to content

Commit 2697793

Browse files
committed
[INTERNAL] Docs: Prevent updating 'next' alias / 404.html
Mike deployment with `--update-aliases` was updating the 'next' alias, overwriting the state that had been deployed from the `main` branch. In addition, an updated version of the 404.html will be deployed from the `main` branch. This change also updates the order of operations in the GitHub workflow to reduce the number of commits and additions/deletions in the `gh-pages` branch. Fixes: #1245
1 parent ac577cf commit 2697793

File tree

3 files changed

+8
-54
lines changed

3 files changed

+8
-54
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v6
2424

2525
- name: Use Node.js LTS 20.x
26-
uses: actions/setup-node@v5.0.0
26+
uses: actions/setup-node@v6
2727
with:
2828
node-version: 20.x
2929

@@ -41,16 +41,13 @@ jobs:
4141
- name: Build docs with Mike
4242
run: ./scripts/buildDocs.sh
4343

44-
- name: Publish docs
45-
run: docker run --rm -v $(pwd):/docs --entrypoint mike --env GIT_COMMITTER_NAME="${GIT_COMMITTER_NAME}" --env GIT_COMMITTER_EMAIL="${GIT_COMMITTER_EMAIL}" $DOCKER_IMAGE set-default stable --push
46-
4744
- name: Build Schema
4845
run: |
4946
npm run schema-generate
5047
npm run schema-workspace-generate
5148
5249
- name: Checkout gh-pages
53-
uses: actions/checkout@v4
50+
uses: actions/checkout@v6
5451
with:
5552
ref: gh-pages
5653
path: gh-pages
@@ -60,12 +57,13 @@ jobs:
6057
cp -R ./site/schema ./gh-pages/
6158
rm -rf ./gh-pages/$MIKE_VERSION/api
6259
cp -R ./site/api ./gh-pages/$MIKE_VERSION/
63-
cp ./scripts/resources/custom404.html ./gh-pages/404.html
6460
- name: Publish Docs
6561
run: |
6662
cd ./gh-pages
6763
git config --local user.email $GIT_COMMITTER_EMAIL
6864
git config --local user.name $GIT_COMMITTER_NAME
6965
git add .
70-
git commit -m "Updating supplemental resources for ${MIKE_VERSION} documentation deployment"
71-
git push
66+
git commit --amend --no-edit
67+
68+
- name: Set default version to stable & push
69+
run: docker run --rm -v $(pwd):/docs --entrypoint mike --env GIT_COMMITTER_NAME="${GIT_COMMITTER_NAME}" --env GIT_COMMITTER_EMAIL="${GIT_COMMITTER_EMAIL}" $DOCKER_IMAGE set-default stable --push

scripts/buildDocs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [[ $MIKE_VERSION ]]; then # Build with Mike (versioning)
1717
echo "Starting building & versioning Docs with Mike version: ${MIKE_VERSION}; alias: ${MIKE_ALIAS}..."
1818
docker run --rm -v $(pwd):/docs --entrypoint mike \
1919
--env GIT_COMMITTER_NAME="${GIT_COMMITTER_NAME}" --env GIT_COMMITTER_EMAIL="${GIT_COMMITTER_EMAIL}" \
20-
$DOCKER_IMAGE deploy $MIKE_VERSION $MIKE_ALIAS --rebase --update-aliases
20+
$DOCKER_IMAGE deploy $MIKE_VERSION $MIKE_ALIAS --rebase
2121

2222
else # Build with MkDocs
2323
echo "Starting building Docs with MkDocs..."

scripts/resources/custom404.html

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)