Publish module index #277
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@v2 | |
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@v5 | |
- 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 |