Skip to content

Commit

Permalink
add gh
Browse files Browse the repository at this point in the history
  • Loading branch information
daveRendon committed May 1, 2024
1 parent 08829ef commit b03d5dc
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 0 deletions.
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-Verified-Modules/pulls)
- [ ] Associated it with relevant [GitHub Issues](https://github.com/Azure/Azure-Verified-Modules/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-Verified-Modules/)
- [ ] 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
52 changes: 52 additions & 0 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Code Review - Linting & Link Checks

on:
pull_request: {}
workflow_dispatch: {}

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

steps:

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

- name: Run github/super-linter
uses: github/super-linter@v6
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/.*|.*/telemetry-information-notice\\.md|.*/platform\\.updateModuleRegistryTables\\.yml"

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"
60 changes: 60 additions & 0 deletions .github/workflows/hugo-build-pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Workflow for building and deploying a Hugo site to GitHub Pages
name: Hugo Build PR Check

on:
pull_request:
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.124.1
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@v4
with:
submodules: recursive
fetch-depth: 0

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

- 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
89 changes: 89 additions & 0 deletions .github/workflows/hugo-site-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# 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 and everyday at 1 am to update dynamic info
push:
branches:
- main
paths:
- 'docs/**'
schedule:
- cron: "0 1 * * *" # Daily Update at 1 am

# 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.124.1
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@v4
with:
submodules: recursive
fetch-depth: 0

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

- 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@v3
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@v4

0 comments on commit b03d5dc

Please sign in to comment.