Repository navigation
107 lines (90 loc) · 3.4 KB
/
Copy pathpages.yml
File metadata and controls
107 lines (90 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Reyas Khan – Azure Master Case Studies
# GitHub Pages deployment workflow
# Deploys index.html + all 5 Microsoft Learning repos as a unified static site
name: Deploy Azure Master Portal to GitHub Pages
on:
push:
branches: ["main"]
workflow_dispatch: # allow manual trigger from GitHub Actions UI
permissions:
contents: read
pages: write
id-token: write
# Only one deployment at a time; cancel in-progress runs
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
name: Build site
runs-on: ubuntu-latest
steps:
- name: Checkout portal repo
uses: actions/checkout@v4
# ── Clone all 5 Microsoft Learning repos ──────────────────────────
- name: Clone AZ-900
run: |
git clone --depth 1 \
https://github.com/MicrosoftLearning/AZ-900-Microsoft-Azure-Fundamentals.git \
AZ-900-Microsoft-Azure-Fundamentals
- name: Clone AZ-104
run: |
git clone --depth 1 \
https://github.com/MicrosoftLearning/AZ-104-MicrosoftAzureAdministrator.git \
AZ-104-MicrosoftAzureAdministrator
- name: Clone AZ-305
run: |
git clone --depth 1 \
https://github.com/MicrosoftLearning/AZ-305-DesigningMicrosoftAzureInfrastructureSolutions.git \
AZ-305-DesigningMicrosoftAzureInfrastructureSolutions
- name: Clone AZ-400
run: |
git clone --depth 1 \
https://github.com/MicrosoftLearning/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions.git \
AZ400-DesigningandImplementingMicrosoftDevOpsSolutions
- name: Clone mslearn-devops
run: |
git clone --depth 1 \
https://github.com/MicrosoftLearning/mslearn-devops.git \
mslearn-devops
# ── Stage the deploy artifact ──────────────────────────────────────
- name: Stage site files
run: |
mkdir -p _site
# Portal entry point
cp index.html _site/index.html
cp .nojekyll _site/.nojekyll
# Copy all 5 repos (only Instructions + Allfiles, skip .git, node_modules)
for repo in \
AZ-900-Microsoft-Azure-Fundamentals \
AZ-104-MicrosoftAzureAdministrator \
AZ-305-DesigningMicrosoftAzureInfrastructureSolutions \
AZ400-DesigningandImplementingMicrosoftDevOpsSolutions \
mslearn-devops
do
mkdir -p "_site/$repo"
rsync -a \
--exclude='.git' \
--exclude='node_modules' \
--exclude='.github' \
--exclude='out' \
"$repo/" "_site/$repo/"
done
- name: List staged files (debug)
run: find _site -maxdepth 3 -name "*.md" | head -40
# ── Upload artifact for Pages deployment ───────────────────────────
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4