mirror of
https://github.com/nubenetes/awesome-kubernetes.git
synced 2026-07-12 18:00:37 +00:00
chore: recreate deployment workflow with new name and group
This commit is contained in:
91
.github/workflows/06.deploy_final.yml
vendored
Normal file
91
.github/workflows/06.deploy_final.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
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@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
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@v4
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
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@v4
|
||||
Reference in New Issue
Block a user