Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 368cf3edca | |||
| 279a15f6ad | |||
| 69a34a5a82 | |||
| 7d7dbe5354 | |||
| ddb44e9846 | |||
| f1f4a69bd1 |
74
.github/workflows/deploy-pages.yml
vendored
Normal file
74
.github/workflows/deploy-pages.yml
vendored
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
name: Release - Build and publish docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ["v*"]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout (tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
pip install -r mkdocs/requirements.txt
|
||||||
|
|
||||||
|
- name: CI gate build (strict)
|
||||||
|
env:
|
||||||
|
MKDOCS_STRICT: ${{ vars.MKDOCS_STRICT }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
export MKDOCS_STRICT="${MKDOCS_STRICT:-true}"
|
||||||
|
tools/mkdocs_build.sh --config mkdocs/mkdocs.yml
|
||||||
|
|
||||||
|
- name: Package site (non-strict)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
export MKDOCS_STRICT="false"
|
||||||
|
scripts/package_site.sh "${GITHUB_REF_NAME}" --config mkdocs/mkdocs.yml --dist "${RUNNER_TEMP}/dist"
|
||||||
|
|
||||||
|
- name: Publish release (GitHub)
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
name: ${{ github.ref_name }}
|
||||||
|
tag_name: ${{ github.ref_name }}
|
||||||
|
files: |
|
||||||
|
${{ runner.temp }}/dist/${{ github.ref_name }}.zip
|
||||||
|
|
||||||
|
- name: Remove RC preview from gh-pages (optional cleanup)
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
git fetch origin gh-pages:gh-pages || true
|
||||||
|
if git show-ref --verify --quiet refs/heads/gh-pages; then
|
||||||
|
git switch gh-pages
|
||||||
|
else
|
||||||
|
echo "No gh-pages branch; nothing to clean."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d rc ]; then
|
||||||
|
rm -rf rc
|
||||||
|
git add -A
|
||||||
|
git config user.name "actions-bot"
|
||||||
|
git config user.email "actions-bot@users.noreply.github.com"
|
||||||
|
git commit -m "Remove RC preview after release ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
||||||
|
git push origin gh-pages
|
||||||
|
else
|
||||||
|
echo "No rc/ directory present; nothing to delete."
|
||||||
|
fi
|
||||||
55
.github/workflows/release.yml
vendored
55
.github/workflows/release.yml
vendored
@@ -43,16 +43,20 @@ jobs:
|
|||||||
|
|
||||||
mkdir -p "${MKDOCS_OUTPUT_DIR}"
|
mkdir -p "${MKDOCS_OUTPUT_DIR}"
|
||||||
|
|
||||||
OFFLINE="${OFFLINE}" mkdocs build \
|
OFFLINE="${OFFLINE:-true}" mkdocs build \
|
||||||
"${FLAGS[@]}" \
|
"${FLAGS[@]}" \
|
||||||
-f "${MKDOCS_CONFIG}" \
|
-f "${MKDOCS_CONFIG}" \
|
||||||
-d "${MKDOCS_OUTPUT_DIR}"
|
-d "${MKDOCS_OUTPUT_DIR}/offline"
|
||||||
|
mkdocs build \
|
||||||
|
"${FLAGS[@]}" \
|
||||||
|
-f "${MKDOCS_CONFIG}" \
|
||||||
|
-d "${MKDOCS_OUTPUT_DIR}/dist"
|
||||||
|
|
||||||
- name: Zip site
|
- name: Zip site
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "${MKDOCS_OUTPUT_DIR}"
|
cd "${MKDOCS_OUTPUT_DIR}"
|
||||||
zip -r "${GITHUB_REF_NAME}.zip" .
|
zip -r "${GITHUB_REF_NAME}.zip" "./offline"
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
@@ -61,7 +65,7 @@ jobs:
|
|||||||
# RC-only step
|
# RC-only step
|
||||||
# -------------------------
|
# -------------------------
|
||||||
- name: Publish prerelease
|
- name: Publish prerelease
|
||||||
if: startsWith(github.ref_name, 'rc-')
|
if: startsWith(github.ref_name, 'rc')
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
@@ -87,7 +91,46 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy
|
- name: Checkout (tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Checkout gh-pages branch
|
||||||
run: |
|
run: |
|
||||||
echo "TBD :)"
|
set -euo pipefail
|
||||||
|
git fetch origin gh-pages:gh-pages || true
|
||||||
|
if git show-ref --verify --quiet refs/heads/gh-pages; then
|
||||||
|
git switch gh-pages
|
||||||
|
else
|
||||||
|
git switch --orphan gh-pages
|
||||||
|
rm -rf ./*
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git commit --allow-empty -m "Initialize gh-pages"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Publish release
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
rm -rf ./* || true
|
||||||
|
cp -a "${MKDOCS_OUTPUT_DIR}/dist/." ""
|
||||||
|
|
||||||
|
git add -A
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git commit -m "Deploy release ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
||||||
|
git push origin gh-pages
|
||||||
|
|
||||||
|
- name: Publish RC preview under /rc/<tag>/
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
rm -rf "rc"* || true
|
||||||
|
mkdir -p "rc/"
|
||||||
|
cp -a "${MKDOCS_OUTPUT_DIR}/dist/." "rc/"
|
||||||
|
|
||||||
|
git add -A
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git commit -m "Deploy RC preview ${GITHUB_REF_NAME}" || echo "No changes to commit"
|
||||||
|
git push origin gh-pages
|
||||||
|
|
||||||
Reference in New Issue
Block a user