-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.77 KB
/
publish-docs.yml
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
# This publishes the list of all public bicep modules to an index file that the Bicep vscode extension can read for intellisense
# and also a human-readable HTML version.
name: Publish module index
on:
schedule:
- cron: 0 8 * * * # Run daily at 8:00 AM
workflow_dispatch:
permissions:
id-token: write
pages: write
contents: read
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
upload-index-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 // Needed to fetch all history and tags
- name: Install packages
run: npm ci
- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID}}
tenant-id: ${{ secrets.AZURE_TENANT_ID}}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID}}
- name: Generate moduleIndex.json
uses: actions/github-script@v7
env:
ACR_USER: ${{ secrets.AZURE_ACR_USER}}
ACR_PASS: ${{ secrets.AZURE_ACR_PASSWORD }}
AZURE_REGISTRY_URL: ${{ vars.AZURE_REGISTRY_URL }}
with:
script: |
const script = require("./scripts/github-actions/generate-module-index-data.js")
await script({ require, github, context, core })
- name: Generate index.md
uses: actions/github-script@v7
with:
script: |
const script = require("./scripts/github-actions/generate-module-index-md.js")
await script({ require, github, context, core })
- name: Upload Markdown artifact
uses: actions/upload-artifact@v4
with:
path: index.md
name: index.md
build-index-page:
runs-on: ubuntu-latest
needs: upload-index-data
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: index.md
path: ./docs/jekyll
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
deploy-index-page:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-index-page
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4