Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac93876087 | |||
| 368cf3edca | |||
| 279a15f6ad | |||
| 69a34a5a82 |
74
.github/workflows/deploy-pages.yml
vendored
74
.github/workflows/deploy-pages.yml
vendored
@@ -1,74 +0,0 @@
|
|||||||
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
|
|
||||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -91,6 +91,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout (tag)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: Checkout gh-pages branch
|
- name: Checkout gh-pages branch
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -108,7 +112,7 @@ jobs:
|
|||||||
- name: Publish release
|
- name: Publish release
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
rm ./* ./.* || true
|
rm -rf assets styles search *{.html,.xml,xml.gz} || true
|
||||||
cp -a "${MKDOCS_OUTPUT_DIR}/dist/." ""
|
cp -a "${MKDOCS_OUTPUT_DIR}/dist/." ""
|
||||||
|
|
||||||
git add -A
|
git add -A
|
||||||
|
|||||||
Reference in New Issue
Block a user