Compare commits
1 Commits
rc2026.2
...
d9aa768b41
| Author | SHA1 | Date | |
|---|---|---|---|
|
d9aa768b41
|
55
.github/workflows/deploy-rc-pages.yml
vendored
55
.github/workflows/deploy-rc-pages.yml
vendored
@@ -2,7 +2,7 @@ name: Deploy RC preview to GitHub Pages
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ["rc*"]
|
tags: ["v*"]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -13,6 +13,30 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Guard - only run for RC tags; deploy only on GitHub
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
TAG="${GITHUB_REF_NAME:-}"
|
||||||
|
CI_PROVIDER="${CI_PROVIDER:-github}"
|
||||||
|
ENABLE_DEPLOY="${ENABLE_DEPLOY:-false}"
|
||||||
|
|
||||||
|
if [[ -z "$TAG" ]] || [[ "$TAG" != v* ]] || [[ "$TAG" != *"-rc"* ]]; then
|
||||||
|
echo "Not an RC tag ($TAG); skipping."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [[ "${ENABLE_DEPLOY}" != "true" ]]; then
|
||||||
|
echo "Skipping deploy: ENABLE_DEPLOY=${ENABLE_DEPLOY}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [[ "${ACT:-false}" == "true" ]]; then
|
||||||
|
echo "Skipping deploy: act"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if [[ "${CI_PROVIDER}" != "github" ]]; then
|
||||||
|
echo "Skipping deploy: CI_PROVIDER=${CI_PROVIDER}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Checkout (tag)
|
- name: Checkout (tag)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -52,25 +76,26 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish RC preview under /rc/<tag>/
|
- name: Publish RC preview under /rc/<tag>/
|
||||||
run: |
|
run: |
|
||||||
|
export MKDOCS_STRICT="${MKDOCS_STRICT:-true}"
|
||||||
export TMPDIR="${RUNNER_TEMP:-$TMPDIR}"
|
export TMPDIR="${RUNNER_TEMP:-$TMPDIR}"
|
||||||
export OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}"
|
export OUTPUT_DIR="${OUTPUT_DIR:-${TMPDIR}/dist/}"
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
rm -rf "rc"* || true
|
REF="${GITHUB_REF_NAME}"
|
||||||
mkdir -p "rc/"
|
mkdir -p "rc/${REF}"
|
||||||
cp -a "$OUTPUT_DIR/." "rc/"
|
rm -rf "rc/${REF:?}/"* || true
|
||||||
|
cp -a "$OUTPUT_DIR" "rc/${REF}/"
|
||||||
|
|
||||||
|
mkdir -p rc
|
||||||
|
if [ ! -f rc/index.html ]; then
|
||||||
|
cat > rc/index.html << 'EOF'
|
||||||
|
<!doctype html><meta charset="utf-8"><title>RC Previews</title>
|
||||||
|
<h1>RC Previews</h1><p>Browse rc/<tag>/</p>
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
git add -A
|
git add -A
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
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 commit -m "Deploy RC preview ${REF}" || echo "No changes to commit"
|
||||||
git push origin gh-pages
|
git push origin gh-pages
|
||||||
- name: Publish prerelease (GitHub)
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
prerelease: true
|
|
||||||
body: |
|
|
||||||
RC preview: https://<org>.github.io/<repo>/rc/
|
|
||||||
|
|
||||||
Tag: ${{ github.ref_name }}
|
|
||||||
Commit: ${{ github.sha }}
|
|
||||||
Reference in New Issue
Block a user