mirror of
https://github.com/nubenetes/awesome-kubernetes.git
synced 2026-07-12 18:00:37 +00:00
92 lines
2.4 KiB
YAML
92 lines
2.4 KiB
YAML
name: 06.1. Final Portal Deploy
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
workflow_dispatch: {}
|
|
|
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
id-token: write
|
|
|
|
# Allow only one concurrent deployment
|
|
concurrency:
|
|
group: "pages-stable"
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Dual Versions
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout master
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install mkdocs-material mkdocs-redirects mkdocs-minify-plugin pymdown-extensions
|
|
pip install -r requirements.txt
|
|
|
|
# 1. Build V1 to a temporary staging area
|
|
- name: Build V1 Edition (Staging)
|
|
run: mkdocs build -f mkdocs.yml -d site_v1_temp/
|
|
|
|
# 2. Deploy V1 to Root (SEO) and /v1/ (Fallback)
|
|
- name: Deploy V1 to Root and Subdirectory
|
|
run: |
|
|
mkdir -p site/v1/
|
|
cp -r site_v1_temp/* site/
|
|
cp -r site_v1_temp/* site/v1/
|
|
rm -rf site_v1_temp/
|
|
|
|
# 3. Build V2 Elite Edition (/v2/)
|
|
- name: Build V2 Elite Edition
|
|
run: mkdocs build -f v2-mkdocs.yml -d site/v2/
|
|
|
|
# 4. Inject Root Redirect to V2 - Human visitors land on V2 by default
|
|
- name: Inject Root Redirect to V2
|
|
run: |
|
|
cat << 'EOF' > site/index.html
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Nubenetes Redirect</title>
|
|
<meta http-equiv="refresh" content="0; url=/v2/">
|
|
</head>
|
|
<body>
|
|
<p>Redirecting to the V2 Elite Portal. <a href="/v2/">Click here</a>.</p>
|
|
</body>
|
|
</html>
|
|
EOF
|
|
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v6
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v5
|
|
with:
|
|
path: './site'
|
|
|
|
deploy:
|
|
name: Deploy to GitHub Pages
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v5
|