Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac93876087 | |||
| 368cf3edca | |||
| 279a15f6ad | |||
| 69a34a5a82 | |||
| 7d7dbe5354 | |||
| ddb44e9846 | |||
| f1f4a69bd1 | |||
| dea9106556 |
59
.github/workflows/release.yml
vendored
59
.github/workflows/release.yml
vendored
@@ -3,7 +3,7 @@ name: Build & publish docs (rc + release)
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "rc-*"
|
||||
- "rc*"
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -43,25 +43,29 @@ jobs:
|
||||
|
||||
mkdir -p "${MKDOCS_OUTPUT_DIR}"
|
||||
|
||||
OFFLINE="${OFFLINE}" mkdocs build \
|
||||
OFFLINE="${OFFLINE:-true}" mkdocs build \
|
||||
"${FLAGS[@]}" \
|
||||
-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
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "${MKDOCS_OUTPUT_DIR}"
|
||||
zip -r "${GITHUB_REF_NAME}.zip" .
|
||||
zip -r "${GITHUB_REF_NAME}.zip" "./offline"
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
steps:
|
||||
# -------------------------
|
||||
# RC-only step
|
||||
# -------------------------
|
||||
- name: Publish prerelease
|
||||
if: startsWith(github.ref_name, 'rc-')
|
||||
if: startsWith(github.ref_name, 'rc')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
prerelease: true
|
||||
@@ -87,7 +91,46 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy
|
||||
- name: Checkout (tag)
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout gh-pages branch
|
||||
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 assets styles search *{.html,.xml,xml.gz} || 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