Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBarnes committed Aug 15, 2023
1 parent 161d5c0 commit a130ea7
Show file tree
Hide file tree
Showing 55 changed files with 1,209 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
indent_size = 2
indent_style = space
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,yaml}]
indent_size = 2
indent_style = space
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/question_feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: General Question/Feedback ❔
description: Just got a question or some general feedback? Let us know
title: "[Question/Feedback]: "
labels: ["question"]
body:
- type: markdown
attributes:
value: |
Thank you for your question/feedback
- type: checkboxes
id: existing-checks
attributes:
label: Check for previous/existing GitHub issues
description: By submitting this issue, you confirm that you have [searched for previous/existing GitHub issues](https://github.com/Azure/azure-monitor-baseline-alerts/issues?q=is%3Aissue+sort%3Aupdated-desc+) to avoid creating a duplicate.
options:
- label: I have checked for previous/existing GitHub issues
required: true
- type: textarea
id: question-feedback-text
attributes:
label: Description
description: Let us know your question or feedback here
validations:
required: true
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Thank you for submitting a Pull Request. Please fill out the template below.-->
# Overview/Summary

Replace this with a brief description of what this Pull Request fixes, changes, etc.

## This PR fixes/adds/changes/removes

1. *Replace me*
2. *Replace me*
3. *Replace me*

### Breaking Changes

1. *Replace me*
2. *Replace me*

## As part of this Pull Request I have

- [ ] Read the Contribution Guide and ensured this PR is compliant with the guide
- [ ] Checked for duplicate [Pull Requests](https://github.com/Azure/azure-monitor-baseline-alerts/pulls)
- [ ] Associated it with relevant [GitHub Issues](https://github.com/Azure/azure-monitor-baseline-alerts/issues) or ADO Work Items (Internal Only)
- [ ] Ensured my code/branch is up-to-date with the latest changes in the `main` [branch](https://github.com/Azure/azure-monitor-baseline-alerts/)
- [ ] Ensured PR tests are passing
- [ ] Updated relevant and associated documentation (e.g. Contribution Guide, Docs etc.)
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
38 changes: 38 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
###########################
###########################
## Markdown Linter rules ##
###########################
###########################

# Linter rules doc:
# - https://github.com/DavidAnson/markdownlint
#
# Note:
# To comment out a single error:
# <!-- markdownlint-disable -->
# any violations you want
# <!-- markdownlint-restore -->
#

###############
# Rules by id #
###############
MD004: false # Unordered list style
MD007:
indent: 2 # Unordered list indentation
MD013:
line_length: 1000 # Line length 80 is far to short
MD026:
punctuation: ".,;:!。,;:" # List of not allowed
MD029: false # Ordered list item prefix
MD033: false # Allow inline HTML
MD036: false # Emphasis used instead of a heading
MD053: false # Super Linter broke this in v4.9.5
MD024: false # Allow multiple headings with same content
MD037: false # Allow spaces inside emphasis markers

#################
# Rules by tags #
#################
blank_lines: false # Error on blank lines
39 changes: 39 additions & 0 deletions .github/linters/mlc_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"ignorePatterns": [
{
"pattern": "^http://localhost"
},
{
"pattern": "^(https:\\/\\/)?([www.]?)+(microsoft.com\\/)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$"
},
{
"pattern": "img/"
},
{
"pattern": "/shortcodes/code/"
},
{
"pattern": "/azure-monitor-baseline-alerts/"
}
],
"httpHeaders": [
{
"comment": "Workaround as suggested here: https://github.com/tcort/markdown-link-check/issues/201",
"urls": [
"https://docs.github.com/"
],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
"timeout": "10s",
"retryOn429": true,
"retryCount": 5,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [
200,
203,
206
]
}
54 changes: 54 additions & 0 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Code Review - Linting & Link Checks

on:
pull_request:
branches:
- main
workflow_dispatch: {}

jobs:
lint:
name: Lint code base
runs-on: ubuntu-latest

steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run github/super-linter
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
# Need to define main branch as default is set to master in super-linter
DEFAULT_BRANCH: main
# Enable setting the status of each individual linter run in the Checks section of a pull request
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The following linter types will be enabled:
VALIDATE_JSON: true
VALIDATE_MARKDOWN: true
VALIDATE_POWERSHELL: true
VALIDATE_YAML: true
VALIDATE_BASH: true
VALIDATE_EDITORCONFIG: true
FILTER_REGEX_EXCLUDE: ".*docs/themes/hugo-geekdoc/.*"

markdown-link-check:
name: Markdown Link Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Check links in markdown files
uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
with:
config-file: ".github/linters/mlc_config.json"
use-verbose-mode: "yes"
use-quiet-mode: "yes"
62 changes: 62 additions & 0 deletions .github/workflows/hugo-build-pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Workflow for building and deploying a Hugo site to GitHub Pages
name: Hugo Build PR Check

on:
pull_request:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/hugo-build-pr-check.yml'
workflow_dispatch: {}

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build PR job
buildpr:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.111.3
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass Embedded
run: sudo snap install dart-sass-embedded

- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"

- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
working-directory: ./docs
87 changes: 87 additions & 0 deletions .github/workflows/hugo-site-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- main
paths:
- 'docs/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: {}

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.111.3
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass Embedded
run: sudo snap install dart-sass-embedded

- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"

- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
working-directory: ./docs

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./docs/public


# Deployment job
deploy:
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@v2
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Hugo
docs/.hugo_build.lock
6 changes: 6 additions & 0 deletions docs/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

Loading

0 comments on commit a130ea7

Please sign in to comment.